background-attachment

The background-attachment property specifies whether background images are fixed with regard to the viewport (fixed), or scroll along with the element (scroll), or its contents (local).

Values

background-attachment: value
Value Initial Description
fixed The background is fixed with regard to the viewport.
local The background is fixed with regard to the element's contents.
scroll scroll The background is fixed with regard to the element itself.

DOM

object.style.backgroundAttachment = "value";

Example | fixed

Example | local

Example | scroll

Example | DOM

External

W3C Cascading Style Sheets, level 1

W3C Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification

W3C CSS Backgrounds and Borders Module Level 3