Box Shadow Vs Drop Shadow

 


- Box Shadow: The box-shadow property is used to add a shadow effect to an element. It includes values for the horizontal offset, vertical offset, blur radius, and color. For example:


element {
box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.2);
}



This creates a shadow that is 5 pixels horizontally, 5 pixels vertically, with a blur radius of 10 pixels and a slightly transparent black color. 🌟

- Drop Shadow: The term "drop shadow" is often used interchangeably with the box-shadow property. Alternatively, you can use the filter property with the drop-shadow() function for a similar effect. Example:

element {
filter: drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.2));
}



Both approaches add a shadow that gives the element a sense of depth and separation from the background.



Post a Comment

0 Comments