22.12.2013 Views

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

W3C CSS2 Cascading Style Sheets, level 2 - instructional media + ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Value: none | [ || ? ,]* [ ||<br />

?] | inherit<br />

Initial: none<br />

Applies to: all elements<br />

Inherited: no (see prose)<br />

Percentages: N/A<br />

Media: visual<br />

This property accepts a comma-separated list of shadow effects to be applied<br />

to the text of the element. The shadow effects are applied in the order specified<br />

and may thus overlay each other, but they will never overlay the text itself.<br />

Shadow effects do not alter the size of a box, but may extend beyond its boundaries.<br />

The stack <strong>level</strong> [p. 125] of the shadow effects is the same as for the<br />

element itself.<br />

Each shadow effect must specify a shadow offset and may optionally specify a<br />

blur radius and a shadow color.<br />

A shadow offset is specified with two values that indicate the distance<br />

from the text. The first length value specifies the horizontal distance to the right of<br />

the text. A negative horizontal length value places the shadow to the left of the<br />

text. The second length value specifies the vertical distance below the text. A<br />

negative vertical length value places the shadow above the text.<br />

A blur radius may optionally be specified after the shadow offset. The blur<br />

radius is a length value that indicates the boundaries of the blur effect. The exact<br />

algorithm for computing the blur effect is not specified.<br />

A color value may optionally be specified before or after the length values of<br />

the shadow effect. The color value will be used as the basis for the shadow<br />

effect. If no color is specified, the value of the ’color’ property will be used<br />

instead.<br />

Text shadows may be used with the :first-letter [p. 66] and :first-line [p. 66]<br />

pseudo-elements.<br />

Example(s):<br />

The example below will set a text shadow to the right and below the element’s<br />

text. Since no color has been specified, the shadow will have the same color as<br />

the element itself, and since no blur radius is specified, the text shadow will not<br />

be blurred:<br />

H1 { text-shadow: 0.2em 0.2em }<br />

The next example will place a shadow to the right and below the element’s<br />

text. The shadow will have a 5px blur radius and will be red.<br />

H2 { text-shadow: 3px 3px 5px red }<br />

The next example specifies a list of shadow effects. The first shadow will be to<br />

the right and below the element’s text and will be red with no blurring. The<br />

second shadow will overlay the first shadow effect, and it will be yellow, blurred,<br />

and placed to the left and below the text. The third shadow effect will be placed<br />

to the right and above the text. Since no shadow color is specified for the third<br />

shadow effect, the value of the element’s ’color’ property will be used:<br />

H2 { text-shadow: 3px 3px red, yellow -3px 3px 2px, 3px -3px }<br />

240

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!