XML technologies / CSS / Advanced websites with CSS / CSS property reference / background-attachment
(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)
The property background-attachment determines whether an HTML element’s background image moves up or down as the user scrolls, or is fixed at a position in the browser window and can thus be scrolled out of the visible browser area.
Inherited: no
See also: background-image
Values
fixed or scroll.
Default value: scroll
Compatibility
CSS version: 1
Supported by Internet Explorer 4 and later, Netscape 6 and later, Opera 5 and later, and all Mozilla versions.
Internet Explorer for Windows (up to version 6) and Opera (up to version 6) correctly support background-attachment: fixed only for the HTML element body. Opera 7, Internet Explorer 5 for Macintosh, Netscape 6.2.1 and later, and Mozilla support background-attachment for all HTML elements.
Example
The following rule assigns a background image to an HTML page and fixes it in place on the page:
body {
background-image: url(/images/texture.gif);
background-attachment: fixed;
}
Copyright © 2006 of the German translation, dpunkt.verlag GmbH
You may print the online version for your private use.
Otherwise, this chapter from “CSS − Anspruchsvolle Websites mit Cascading Stylesheets” is subject to the same conditions as the bound edition: the work, including all its parts, is protected by copyright. All rights reserved, including reproduction, translation, microfilming, and storage and processing in electronic systems.
dpunkt.verlag GmbH, Ringstraße 19, 69115 Heidelberg