CSS2 » Properties » background-attachment

Version: Level 1

Compability:  IE4+  N6

Syntax:
background-attachment : scroll | fixed
fixed
The fixed value causes the background to remain fixed in place. The foreground text and images move over the fixed background as you scroll up or down or right or left.
scroll
The scroll value causes the background image to move along with the foreground text and images as you scroll up or down or right or left.

The background-attachment property allows you to choose if the background is fixed or scrolls. This property is not inherited.

Examples

Code:
body
{
  background-image: url("anasazi.tif");
  background-attachment: scroll;
}
 
html
{
  background-image: url("anasazi.tif");
  background-attachment: fixed;
}
Language(s): CSS2

See Also: