/

HTML / CSS / JavaScript Tutorial

CSS Property: background-attachment

[this page | pdf | back links]

The CSS (CSS1) background-attachment property indicates whether a background image is fixed or scrolls with the rest of the page.

 

Valid property values (other than inherit and initial) are:

 

Value

Description

fixed

Background is fixed in relation to viewport

local

Background scrolls along with the element’s contents

scroll

(default value). Background scrolls along with the element

 

Default Value:

scroll

JavaScript syntax:

e.g. object.style.backgroundAttachment="fixed"

Inherited:

No

Animatable:

No

 


NAVIGATION LINKS
Contents | Prev | Next | CSS Properties


Desktop view | Switch to Mobile