CSS shadows add visual depth to elements. The box-shadow property applies to boxes, while text-shadow applies to text. These can be used to highlight content and create stylish designs.
In the following example, we add a shadow to a box that is offset to the right and downward with a slight blur. The shadow color is semi-transparent black.
The example shows the basic usage of the box-shadow property.
Box-shadow consists of several parameters: horizontal offset, vertical offset, blur, spread, and color. By combining these, different effects can be achieved.
Parameter | Description |
---|---|
h-offset | The horizontal offset of the shadow. |
v-offset | The vertical offset of the shadow. |
blur-radius | The blur radius of the shadow. |
spread-radius | The spread radius of the shadow. |
color | The color of the shadow. |
Use shadows carefully so they create a natural effect and do not harm readability.
Please sign in to ask Lara about CSS Shadows.
Select Language
Set theme
© 2025 ReadyTools. All rights reserved.