Name
background-attachment — NN n/a IE 4 CSS 1
Synopsis
Inherited: No
When an image is applied to the element background (with the
background-image attribute), the
background-attachment attribute sets how the image
is attached to the document. The image can remain fixed within the
viewable area of the element (the viewport), or it may scroll with
the element as the document is scrolled. During scrolling, a fixed
attachment looks like a stationary backdrop to rolling credits of a
movie.
CSS Syntax
background-attachment: fixed | scroll
Value
The fixed value keeps the image stationary in the
element viewport; the scroll value lets the image
scroll with the document content.
Initial Value
scroll
Example
BODY {background-attachment: fixed}Applies To
All elements.
Object Model Reference
- IE
[window.]document.all.elementID.style.backgroundAttachment
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access