Computer >> คอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

เพิ่มเอฟเฟกต์เงาให้กับองค์ประกอบด้วย CSS


ใช้คุณสมบัติ box-shadow เพื่อเพิ่มเอฟเฟกต์เงาให้กับองค์ประกอบ

ต่อไปนี้คือตัวอย่างการเพิ่มเอฟเฟกต์เงา −

ตัวอย่าง

<html>
   <head>
      <style>
         div {
            width: 300px;
            height: 100px;
            padding: 15px;
            background-color: red;
            box-shadow: 10px 10px;
         }
      </style>
   </head>
   <body>
      <div>This is a div element with a box-shadow</div>
   </body>
</html>

ผลลัพธ์

เพิ่มเอฟเฟกต์เงาให้กับองค์ประกอบด้วย CSS