Fixing and Scrolling Background Images
You can have your background image fixed to the browser's viewport, or allow it to scroll along with the document by using the background-attachment property along with a value of either fixed or scroll.[View full width]body {background-image: url(arrows.gif); background-position: right; background-repeat:
no-repeat; background-attachment: scroll;}Here, I've attached a background image, positioned it to the right with no repeat, and scrolled the background. This actually creates a rule that mimics default browser behavior, which is to scroll the background with the content (see Figure 8-11).
Figure 8-11. When a background graphic is set to scroll, it scrolls along with the element to which it's attachedin this case, the body.

Figure 8-12. No matter where I scroll, the background image remains fixed in this case.

HTML and CSS
By
Molly E. Holzschlag...............................................
Publisher: Addison Wesley ProfessionalPub Date: April 22, 2005ISBN: 0-13-185586-7
Pages: 336
Index