May 05, 2021 CSS Reference Manual
Background-attachment sets whether the background image is fixed or scrolls with the rest of the page.
Default: | scroll |
---|---|
Inherited: | no |
Version: | CSS1 |
JavaScript syntax: | object object.style.backgroundAttachment="fixed" |
Value | Description |
---|---|
scroll | The background picture scrolls with the rest of the page. This is the default |
fixed | The background image is fixed |
inherit | The settings that specify background-attachment should be inherited from the parent element |
local |
The background picture scrolls with the scroll element
|
How to specify a fixed background image:
The numbers in the table support the first browser version number of the property.
The number immediately before -webkit-, -ms- or -moz- is the first browser version number that supports the prefix property.
Attributes | |||||
---|---|---|---|---|---|
background-attachment | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
CSS tutorial: CSS Background