B.3. background-attachment

This property determines whether the background image assigned to an element scrolls in sync with the element's content or remains fixed in relation to the browser window. For example, if you wanted the top-left corner of your page background image to remain in the top-left corner of the browser window, even as the page was scrolled, you would set background-attachment to fixed.

Inherited: No

See also: Section B.5background-image

B.3.1. Value

fixed or scroll

Initial value: scroll

B.3.2. Compatibility

CSS Version: 1

Supported by Internet Explorer 4 or later, Netscape 6 or later, Opera 5 or later, and all Mozilla browsers.

Internet Explorer for Windows (at least up to version 6) and Opera browsers (up to version 6), do not correctly support background-attachment: fixed on elements besides body. Opera 7, Internet Explorer 5 for Macintosh, Netscape 6.2.1 or later, and Mozilla browsers all get this right.

B.3.3. Examples

This style rule applies a background image to the page and specifies that the image should not scroll with the page content:

body {
  background-image: url(/images/texture.gif);
  background-attachment: fixed;
}

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset