background-attachmentLimited availability
The background-attachment CSS property sets whether an element's background image or gradient moves as the element scrolls.
Not yet supported in all major browsers — check the table and provide a fallback.
Browser support
DesktopChrome
1+Supportedsince Dec 11, 2008
Current: 155Edge
12+Supportedsince Jul 29, 2015
Current: 154Firefox
1–24Not supported
25+Supportedsince Oct 29, 2013
Current: 157Safari
1–15.3Not supported
15.4+Supportedsince Mar 14, 2022
Current: 27MobileChrome Android
18+Supportedsince Jun 27, 2012
Current: 155Firefox Android
4–24Not supported
25+Supportedsince Oct 29, 2013
Current: 157Safari iOS
✕Not supportedup to 27
Current: 27How to use
Not supported in Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.
Example
Full syntax and examples are on MDN: background-attachment.
Feature detection
CSS · check before using
@supports (background-attachment: initial) {
/* styles that rely on background-attachment */
}
/* or in JavaScript */
if (CSS.supports("background-attachment", "initial")) {
// use it
}Documentation (MDN)
Specification
Usage share
Sub-features
Support for each part of the feature (5). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| background-attachment | 1 | 12 | 1 | 1 | 18 | 4 | 3.2 |
| background-attachment.fixed | 1 | 12 | 2 | 15.4 | 18 | 4 | ✕ |
| background-attachment.local | 1 | 12 | 25 | 15.4 | 18 | 25 | 15.4 |
| background-attachment.multiple_backgrounds | 1 | 12 | 3.6 | 1.3 | 18 | 4 | 3.2 |
| background-attachment.scroll | 1 | 12 | 1 | 1 | 18 | 4 | 3.2 |