HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

background-attachment

Description

The background-attachment property for CSS specifies whether background images are fixed with regard to the viewport (fixed), or scroll along with the element (scroll), or its contents (local).

Syntax

CSS

background-attachment: value;

JS

object.style.backgroundAttachment = "value";

Values

<'background-attachment'> = <attachment>#
<attachment> = scroll | fixed | local
scroll

The background is fixed with regard to the element itself.

fixed

The background is fixed with regard to the viewport.

local

The background is fixed with regard to the element's contents.

Initial

scroll

Examples

1 · fixed

2 · local

3 · scroll

4 · JS