CSS Background-attachment Property

Reference on the CSS Background-attachment Property.

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!

Post comment

Links that you insert are not nofollowed, but will be removed by admins if they are considered spam.

[url=Absolute URL for page]TITLE[/url]

You should insert code boxes around code examples, which will be automatically syntax highlighted.

[code1 html|css|javascript|php|sql]Your Code Here[/code1]

You may want to read our Privacy Policy before submitting your comment.