Skip to main content
HTML Validation

CSS: “background-attachment”: X is not a “background-attachment” value.

About This CSS Issue

The background-attachment property only accepts scroll, fixed and local, so the validator reports any other value, such as static, none or auto.

static is the default of position, not of background-attachment. The default here is scroll, which ties the background to the element itself: it moves with the page, but not with content that scrolls inside the element. fixed pins the background to the viewport, and local makes it scroll along with the element's own content.

Browsers ignore the invalid declaration, so the background falls back to scroll, or to whatever an earlier rule set. If you wrote static to cancel a fixed background, the background stays fixed until you change the value to scroll.

With several background layers, the property takes a comma-separated list such as scroll, fixed. One bad keyword in the list is enough to trigger the error, and the browser then drops the whole declaration. In the background shorthand the same mistake produces a different message: “background”: “static” is not a “background-color” value.

Invalid example

.hero {
background-image: url("hero.jpg");
background-attachment: static;
}

Valid example

.hero {
background-image: url("hero.jpg");
background-attachment: scroll;
}

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Help us improve our guides

Was this guide helpful?
🌍 Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
€5 / week

1K Weekly

1,000 monthly checks. Cancel anytime.

Get 1K Weekly →

Join teams across 40+ countries