If background images are specified, this property specifies whether they are fixed with regard to the viewport or scroll along with the element or its contents.
If background images are specified, this property specifies whether they are fixed with regard to the viewport (
fixed) or scroll along with the element (
scroll) or its contents (
background: <attachment> [ , <attachment> ]*;
fixed The background is fixed with regard to the viewport. In paged media where there is no viewport, a ‘fixed’ background is fixed with respect to the page box and therefore replicated on every page. Note that there is only one viewport per view. Even if an element has a scrolling mechanism (see the overflow property), a
fixedbackground doesn't move with the element.
local The background is fixed with regard to the element's contents: if the element has a scrolling mechanism, the background scrolls with the element's contents. In this case, the background behind the element's border (if any) scrolls as well, even though the border itself does not scroll with the contents. The UA may, however, treat the
border-boxvalue of background-clip as
padding-boxin cases where background-attachment is
localand the contents of the element scroll.
scroll (by default) The background is fixed with regard to the element itself and does not scroll with its contents. (It is effectively attached to the element's border.)