1. Computing

Discuss in my forum

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:

©2013 About.com. All rights reserved.