New! My 44-page ebook "CSS in 44 minutes" is out! 😃

Get it now →

#background-attachment

Defines how the background image will behave when scrolling the page.

default background-attachment: scroll;

The background image will scroll with the page. It will also position and resize itself according to the element it's applied to.

background-attachment: fixed;

The background image will not scroll with the page, and remain positioned according to the viewport. It will also position and resize itself according to the viewport. As a result, the background image will probably only be partially visible.