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

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


ใช้ CSS box-shadow คุณสมบัติเพื่อเพิ่มเงาให้กับองค์ประกอบโดยใช้ CSS คุณสามารถลองเรียกใช้โค้ดต่อไปนี้เพื่อใช้คุณสมบัติ box-shadow:

ตัวอย่าง

<!DOCTYPE html>
<html>
   <head>
      <style>
         h2 {
            box-shadow: 10px 10px;
            height: 50px;
            background-color: yellow;
         }
      </style>
   </head>
   <body>
      <h2>Heading Two</h2>
      <p>Above heading has shadow.<p>
   </body>
</html>