background-attachment

Back to the index.

This page tests background-attachment. How is the background image attached to its element? Does it scroll with the element, the document, or not at all?

scroll (default)

The background image scrolls with the document. And no, the name of this value has never made any sense, but it seems we’re stuck with it.

Scrollable

Test
Test
Test
Test
Test
Test
Test

fixed

Background is fixed relative to the entire window. The element merely serves as a viewport through which you look at the background image.

In order to see the fixed background in action, scroll the main window slowly.

Scrollable

Test
Test
Test
Test
Test
Test
Test

local

The background scrolls with the element.

Scrollable

Test
Test
Test
Test
Test
Test
Test