CSS3 text-shadow Property
Example
Basic text shadow (text-shadow):
h1
{
text-shadow: 2px 2px #ff0000;
}
Try it »
There are more examples at the bottom of this page.
Browser support
The numbers in the table indicate the first browser version that supports this property.
| property | |||||
|---|---|---|---|---|---|
| text-shadow | 4.0 | 10.0 | 3.5 | 4.0 | 9.6 |
Property definition and usage
The text-shadow property applies a shadow to text.
| Default value: | none |
|---|---|
| Inherited: | yes |
| Version: | CSS3 |
| JavaScript syntax: | object.style.textShadow="2px 2px #ff0000" |
Syntax
text-shadow:
h-shadow v-shadow blur color
;
Note: The text-shadow property attaches one or more shadows to text. A shadow is specified with two or three length values and an optional color value, separated by commas. Omitted lengths default to 0.
| Value | Description |
|---|---|
| h-shadow | Required. The position of the horizontal shadow. Negative values are allowed. |
| v-shadow | Required. The position of the vertical shadow. Negative values are allowed. |
| blur | Optional. The blur distance. |
| color | Optional. The color of the shadow. See A CSS color value. |
More examples
Text shadow blur effect
This example demonstrates a text shadow blur effect.
Text shadow on white text
This example demonstrates a text shadow on white text.
Neon glow text shadow
This example demonstrates a text shadow with a neon light glow.