style.textShadow (Property)

Controls artistic shadow effects for text in the styled element.

Availability:

CSS level - 2
DOM level - 2
JavaScript - 1.5
JScript - 5.0
Internet Explorer - 5.0
Netscape - 6.0
Property/method value type:String primitive
JavaScript syntax:-myStyle.textShadow
CSS syntax:text-shadow: aValueH aValueV aRadius, ... text-shadow: aColor aValueH aValueV aRadius, ...
Argument list:aColorA color for the blur
aValueHA horizontal blur factor
aValueVA vertical blur factor
aRadiusA blur radius

This is an alternative to using the visual filter effects in MSIE. With this, you can add several shadows to the text, each one having a different color. The shadows can be vertically and horizontally offset from the text on an individual basis. This simulates the effect of the text being lit from several angles with different light sources.

Although the text shadows are layered with the text itself when the Z order of the text is changed with respect to other elements in the page, the shadows move with it as if they were in some kind of layer group.

The values for the one particular shadow are space-separated and should be specified in the correct order since several of them are length values and therefore they share the same namespace.

Each set of arguments for a shadow layer should be separated from the previous one by a comma so there are two levels of delimiting going on.

As an alternative, the keyword value none can be assigned to the property to deactivate shadows altogether.

The arguments for each shadow layer are as follows and should be defined in this order:

If the color value is omitted, the color of the element object itself will be used. This value may not have been defined for the element object and may have been inherited from a parent containing element object.

Negative values can be used for the horizontal and vertical offset values.

See also:filter - Shadow(), Filter object, style.filter, style.zIndex