Name

text-shadow — NN n/a IE n/a CSS 2

Synopsis

Inherited: No

Sets shadow effects for the text of the current element. A text element can have more than one shadow, and each shadow can have its own color, vertical offset, horizontal offset, and blur radius. Each shadow exists in its own minilayer, stacked with the first shadow specification at the bottom of the heap. Even so, text shadows move with their text element as a unit when the z-index attribute of the element is set or modified. Values for each shadow are space-delimited, and multiple shadow value sets are comma-delimited.

CSS Syntax

text-shadow: [color] horizLength 
                     vertLength 
                     blurRadiusLength,
    [[color] horizLength 
                     vertLength 
                     blurRadiusLength] | none

Value

If you omit the color attribute value, the shadow uses the element’s color property value (which may, itself, be inherited). The color attribute can be placed before or after whatever length values are set for a shadow. See the discussion of color values at the beginning of this chapter. Values for horizLength and vertLength are length values (see the beginning of this chapter), and their sign indicates the direction the shadow offset takes from the element text. For the horizLength value, a positive value places the shadow to the right of the element; a negative value to the left. For the vertLength value, a positive value places the shadow below the text; a negative value above. A blur radius is a length value (see the beginning of this chapter) that specifies the extent ...

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.