1. Home
  2. Computing & Technology
  3. Web Design / HTML

background-attachment

By , About.com Guide

background-attachment Description:

The background-attachment property defines the whether a background image is fixed in relation to the canvas or if it scrolls allong with the surrounding content.

background-attachment in CSS Versions:
background-attachment Syntax:

background-attachment: scroll | fixed | inherit

  • scroll
    The standard, the image scrolls with the content.
  • fixed
    The image is fixed in relation to the canvas and the content scrolls over it.
  • repeat-y
    Repeat vertially only.
  • no-repeat
    Do not repeat the image, display it only once.
  • inherit
    The element should have the same background-attachment setting as the parent.
background-attachment Initial Value:

scroll

background-attachment Applies To:

All elements.

background-attachment Inheritance:

This property is not inherited.

background-attachment Browser Support:
background-attachment Examples:

fixed position

<p style="background-attachment : fixed; background-image : /library/graphics/purple.gif;">
This paragraph has the purple.gif image as a background that is fixed below the content.
</p>
background-attachment Special Notes:
  • The background-attachment property only reliably works in the <body> tag in many browsers.
  • This style requires a background image set.
More background-attachment Information:

Return to the Style Library

Explore Web Design / HTML
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Web Design / HTML
  4. CSS
  5. Style Properties
  6. CSS Style Property: background-attachment>

©2009 About.com, a part of The New York Times Company.

All rights reserved.