CSS shadow effects refer to techniques used to create visual shadows around HTML elements on a webpage using Cascading Style Sheets (CSS). Shadows can enhance the appearance of elements, providing depth and dimensionality to the design. There are several types of shadow effects that can be achieved using CSS:
CSS Text Shadow
CSS text-shadow is a property that allows you to add a shadow effect to the text of an HTML element. It can be used to enhance the visual appearance of text by creating a shadow behind it. The text-shadow property takes a set of values to define the offset, blur radius, and color of the shadow.
Example
h1 {
text-shadow: 2px 2px;
}
Output
Text-shadow effect!
Next, add a color (red) to the shadow:
Example
h1 {
text-shadow: 2px 2px red;
}
You can click on above box to edit the code and run again.
Output
Text-shadow effect!
Then, add a blur effect (5px) to the shadow:
Example
h1 {
text-shadowv: 2px 2px 5px red;
}
You can click on above box to edit the code and run again.