CSS text-shadow

The CSS text-shadow property is used to add shadows to text. This property accepts a comma-separated list of shadow effects to be applied to the text. Each shadow effect is specified by giving values for the horizontal offset, vertical offset, blur radius, and color of the shadow. You can also add multiple shadows to text by separating each shadow effect with a comma.

Here is the syntax for the text-shadow property:

text-shadow: h-shadow v-shadow blur-radius color;

Where:

Example:

Result:

This is a sample text with a shadow effect.

In this example, we applied a shadow to the text using the text-shadow property. The values 2px 2px 5px #000000 denote a shadow with a horizontal offset of 2 pixels, a vertical offset of 2 pixels, a blur radius of 5 pixels, and a black color for the shadow.

You can further customize the shadow effect by playing around with the values of the text-shadow property to achieve different shadow effects for your text.

Related CSS topics