HTML & CSS Wiki
Advertisement

The CSS text-shadow property is used to apply shadow effects to text and its text-decorations. Multiple shadow effects are applied front-to-back; the first shadow is on top. This property is not supported by Internet Explorer.

Values[]

Value Description
<color> Optional, allowed before or after the <length> values. If <color> is not specified, a user agent-chosen color will be used. Gecko uses the value of the element's color property. Other browsers may differ. Valid color names or color codes are accepted.
<offset-x> <offset-y> Required. These <length> values set the shadow offset. <offset-x> specifies the horizontal distance. Negative values place the shadow to the left of the text. <offset-y> specifies the vertical distance. Negative values place the shadow above the text. If both values are 0, the shadow is placed behind the text (and may generate a blur effect when <blur-radius> is set). Examples of lengths are px, em, etc.
<blur-radius> Optional. This is a <length> value. If not specified, it will be 0. The higher this value, the bigger the blur, so the shadow becomes wider and lighter.


HTML example:

<div style="text-shadow:5px 5px 10px white;">TEXT</div>

That produces:

TEXT

Image example: Text-shadow


CSS examples:

text-shadow:orange 0 -2px;

produces: Text-shadow Ex1


text-shadow:1px 1px 2px black, 0 0 1em blue, 0 0 0.2em blue; color:white; font:1.5em Georgia;

produces: Text-shadow Ex2

Advertisement