Style backgroundAttachment Property
Style backgroundAttachment Property
The backgroundAttachment property is used to either set or return whether a background image should scroll with the content or it should be fixed.
Syntax:-
Its syntax is:- object.style.backgroundAttachment OR object.style.backgroundAttachment = scroll|fixed|local|initial|inherit
Return:-
Its return is:- string having the background image attached to the object within the document
Further Explanation:-
Value | Description |
---|---|
scroll | The background scrolls along with the element. |
fixed | The background is fixed with regard to the viewport |
local | The background scrolls along with the element contents. |
initial | Sets property to its default value. |
inherit | Inherits property from its parent element. |