Export (0) Print
Expand All
top
Expand Minimize

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

 

Syntax

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
Mediavisual
Inheritedno
Initial Valuescroll

Standards information

Remarks

This property can be set with the other background properties by using the IHTMLCSSStyleDeclaration::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 IHTMLCSSStyleDeclaration::backgroundImage property. Each of the images is sized, positioned, and tiled according to the corresponding value in the other background properties (IHTMLCSSStyleDeclaration::backgroundAttachment, IHTMLCSSStyleDeclaration::backgroundClip, IHTMLCSSStyleDeclaration::backgroundOrigin, IHTMLCSSStyleDeclaration::backgroundPosition, IHTMLCSSStyleDeclaration::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.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Mshtml.h

IDL

Mshtml.idl

DLL

Mshtml.dll

 

 

Community Additions

ADD
Show:
© 2014 Microsoft