Visit Mozilla.org

CSS:background-attachment

From MDC

« CSS Reference

[edit] Summary

If a background-image is specified, background-attachment determines whether that image's position is fixed within the viewport, or scrolls along with its containing block.

[edit] Syntax

background-attachment: scroll | fixed | inherit

[edit] Values

scroll 
If scroll is specified, the background image will scroll within the viewport along with the block the image is contained within.
fixed 
If fixed is specified, the background image will not scroll with its containing element, instead remaining stationary within the viewport.

[edit] Examples

View Live Examples

body {
	background-image: url("images/cartooncat.png");
	background-position: bottom left;
	background-attachment: fixed;
	background-repeat: no-repeat;
}

[edit] Specifications

[edit] Browser Compatibility

[edit] Browser Compatibility

Browser Lowest Version
Internet Explorer 4
Firefox 1
Netscape 6
Opera 3.5

[edit] See Also

background, background-attachment, background-color, background-image, background-position, background-repeat