Fandom

Background-attachment

648pages on
this wiki
Add New Page
Comments0 Share

The background-attachment property is used in CSS and certain HTML elements. If a background-image is specified, this property determines whether that image's position is fixed within the viewport, or scrolls along with its containing block.


ValuesEdit

  • scroll - If specified, the background image will scroll within the viewport along with the block the image is contained within.
  • fixed - If specified, the background image will not scroll with its containing element, instead it will remain stationary within the viewport.


HTML example:

<body style="background-image:url('Wiki.png'); background-attachment:scroll;">
Body content.
</body>


CSS example:

body {
      background-image:url("Wiki.png");
      background-attachment:scroll;
}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.