CSS BACKGROUND-ATTACHMENT

  • Share
  • Share

The background-attachment property sets whether a background image is fixed or scrolls with the rest of the page.

Inherited: No

Example

body
{
  background-image: url(stars.gif);
  background-attachment: scroll
}

Possible Values

Value Description
scroll The background image moves when the rest of the page scrolls
fixed The background image does not move when the rest of the page scrolls.