Availability: |
| |||||||
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: | aColor | A color for the blur | ||||||
aValueH | A horizontal blur factor | |||||||
aValueV | A vertical blur factor | |||||||
aRadius | A 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:
A color value (optional and may be omitted).
The horizontal offset value in spatial coordinates
The vertical offset value in spatial coordinates
The blur radius value in spatial coordinates
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 |
Prev | Home | Next |
style.textKashidaSpace | Up | style.textTransform |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |