CSS background-attachment Property


In CSS, the background-attachment property is used to describe the type of attachment of the background image to its container. It may be configured to scroll or to remain stationary. It is applicable to all HTML components.

Syntax

Example

Preview

Property Values

Value Description
scroll The background picture will follow the page as it scrolls. This is the default setting.
fixed The background picture will not follow the page as it scrolls.
local The background picture will follow the element's content as it scrolls.
initial Set this property to its default value.
inherit Inherits this property from its parent element.

Supported Browsers

Element Chrome Firefox Safari Edge / IE Opera
background-attachment 1.0 1.0 1.0 4.0 3.5