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

> Canonical HTML version: https://rocketvalidator.com/html-validation/css-background-attachment-x-is-not-a-background-attachment-value
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

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

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

## Valid example

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