View video tutorial

CSS Text Shadow

CSS

This property adds shadow to text.

CSS Text Shadow.

➔ The text-shadow property is used to specify shadow to text.

➔ This can be done in following ways.

Syntax

text-shadow: h-shadow v-shadow blur-radius color|none|initial|inherit;

Property values

Value Description
h-shadow The horizontal offset of the shadow. (Required)
v-shadow The vertical offset of the shadow. (Required)
blur-radius The blur radius of the shadow. (Optional)
color The color of the shadow. (Optional)
none No shadow. This is default.
initial Sets the property to its default value.
inherit The element inherits the property value from its parent element.

Example

#p1 {
  text-shadow: 2px 2px;
}
Try it Now »

Click on the "Try it Now" button to see how it works.


CSS Text Shadow Add Color.

  • text-shadow: 2px 2px red;

Example

#p1 {
  text-shadow: 2px 2px red;
}
Try it Now »

Click on the "Try it Now" button to see how it works.