CSS:background-attachment
From MDC
[edit] Summary
If a background-image is specified, background-attachment determines whether that image's position is fixed within the viewport, or scrolls along with its containing block.
- Initial value: scroll
- Applies to: all elements
- Inherited: no
- Percentages: N/A
- Media:
visual - Computed value: as specified
[edit] Syntax
background-attachment: scroll | fixed | inherit
[edit] Values
- scroll
- If
scrollis specified, the background image will scroll within the viewport along with the block the image is contained within. - fixed
- If
fixedis specified, the background image will not scroll with its containing element, instead remaining stationary within the viewport.
[edit] Examples
body {
background-image: url("images/cartooncat.png");
background-position: bottom left;
background-attachment: fixed;
background-repeat: no-repeat;
}
[edit] Specifications
[edit] Browser Compatibility
[edit] Browser Compatibility
| Browser | Lowest Version |
|---|---|
| Internet Explorer | 4 |
| Firefox | 1 |
| Netscape | 6 |
| Opera | 3.5 |
[edit] See Also
background,
background-attachment,
background-color,
background-image,
background-position,
background-repeat