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.

ody text body text body text body text body<br />

text body text body text.<br />

body text body text body text body text<br />

body text<br />

body text body text body text body text body<br />

text body text body text body text body text<br />

body text body text<br />

center image<br />

body text body text body text body text body<br />

text body text body text.<br />

body text body text body text body text<br />

body text<br />

body text body text body text body text body<br />

text body text body text body text body text<br />

body text body text<br />

body text body text body text body text body<br />

text body text body text.<br />

body text body text body text body text<br />

body text<br />

body text body text body text body text body<br />

text body text body text body text body text<br />

body text body text<br />

One copy of the background image is centered, and other copies are put<br />

above and below it to make a vertical band behind the element.<br />

’background-attachment’<br />

Value: scroll | fixed | inherit<br />

Initial: scroll<br />

Applies to: all elements<br />

Inherited: no<br />

Percentages: N/A<br />

Media: visual<br />

If a background image is specified, this property specifies whether it is fixed<br />

with regard to the viewport [p. 96] (’fixed’) or scrolls along with the document<br />

(’scroll’).<br />

Even if the image is fixed, it is still only visible when it is in the background or<br />

padding area of the element. Thus, unless the image is tiled (’background-repeat:<br />

repeat’), it may be invisible.<br />

Example(s):<br />

This example creates an infinite vertical band that remains "glued" to the viewport<br />

when the element is scrolled.<br />

BODY {<br />

background: red url("pendant.gif");<br />

background-repeat: repeat-y;<br />

background-attachment: fixed;<br />

}<br />

190

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

Saved successfully!

Ooh no, something went wrong!