หากต้องการเพิ่มสีให้กับเงา ให้ใช้ box-shadow คุณสมบัติและกำหนดสีด้วยความสูงและความกว้าง
คุณสามารถลองเรียกใช้โค้ดต่อไปนี้เพื่อตั้งค่าสีเป็นเงา:
ตัวอย่าง
<!DOCTYPE html>
<html>
<head>
<style>
h2 {
box-shadow: 10px 10px green;
height: 70px;
background-color: red;
}
</style>
</head>
<body>
<h2>Heading Two</h2>
<p>Above heading has shadow.</p>
</body>
</html>