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

เพิ่มเอฟเฟกต์เงา (Box Shadow) ให้องค์ประกอบด้วย 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>

ผลลัพธ์

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