Property Description
The text-shadow property sets the shadow effect added to text.
This property has the following syntax:
text-shadow: x_offset y_offset blur color|initial|inherit;
Property Values
Value | Description |
---|---|
x_offset | The X offset to place the shadow. Negative values move the shadow to the left. |
y_offset | The Y offset to place the shadow. Negative values move the shadow up. |
blur | (optional) The number of pixels to stretch the shadow giving a blur effect. |
color | (optional) The color of the shadow |
initial | Specifies that the value of the property should be set to the default value |
inherit | Specifies that the value of the property should be inherited from the parent element |
Examples
This example places a shadow on h1 elements.
h1
{
text-shadow:2px 2px 2px #000;
}
This example shows the results of setting the various text-shadow values:
text-shadow:none;
text-shadow:0.1em 0.1em black;
text-shadow:1px 2px 5px black;
text-shadow:1px 1px red,
2px 2px blue;
text-shadow:0.1em 0.1em black;
text-shadow:1px 2px 5px black;
text-shadow:1px 1px red,
2px 2px blue;
Browser Support
Chrome | Firefox | IE | Safari | Opera |
---|---|---|---|---|
4.0 | 3.5 | 10.0 | 4.0 | 9.6 |
Miscellaneous Information
Inherited: | Yes |
---|---|
Defined In: | CSS3 |
Default Value: | none |