Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

backgroundAttachment property

Specifies how the background image (or images) is attached to the object within the document.

CSS Backgrounds and Borders Module Level 3, Section 3.5CSS 2.1, Section 14.2.1


Integer value = object.put_backgroundAttachment( v);Integer value = object.get_backgroundAttachment(* sAttachment);

Property values

Type: BSTR

scroll (scroll)

Default. Background image scrolls with the object as the document is scrolled.

fixed (fixed)

Background image stays fixed within the viewable area of the object.

local (local)

Internet Explorer 9 and later. Background image stays fixed with regard to the element's contents: if the element has a scrolling mechanism, the background scrolls with the element's contents.

String format

scroll | fixed | local [ , scroll | fixed | local ]*

CSS information

Applies ToAll elements
Initial Valuescroll

Standards information


This property can be set with the other background properties by using the IHTMLStyle::background composite property.

Starting in Internet Explorer 9, the background of an element can have multiple layers. The number of layers is determined by the number of comma-separated values in the IHTMLStyle::backgroundImage property. Each of the images is sized, positioned, and tiled according to the corresponding value in the other background properties (IHTMLStyle::backgroundAttachment, IHTMLCSSStyleDeclaration::backgroundClip, IHTMLCSSStyleDeclaration::backgroundOrigin, IHTMLStyle::backgroundPosition, IHTMLStyle::backgroundRepeat, and IHTMLCSSStyleDeclaration::backgroundSize). The first image in the list is the layer closest to the user, the next one is painted behind the first, and so on.


Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]









Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

© 2014 Microsoft. All rights reserved.