By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

CSS Background-attachment Property

Reference on the CSS Background-attachment Property.

Edited: 2015-02-21 15:01

The CSS Background-attachment Property sets the attachment of the background. It is often used to "fix" the background, instead of having it scroll together with the content.

Possible Values

  1. fixed
  2. scroll (Default)

background-attachment example

The following example first sets a background-image, and then sets its attachment to fixed.

body {
  background-image: url("MyImage.png");
  background-attachment: fixed;

Inherited? - NO!