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

background property

Specifies up to five separate background properties of an object.

CSS Backgrounds and Borders Module Level 3, 3.10CSS 2.1, Section 5.3.7

Syntax

Integer value = object.put_background( v);Integer value = object.get_background(* sBackground);

Property values

Type: BSTR

up to five of the space-delimited Possible Values, in any order.

color (transparent)

Any of the range of color values available to the IHTMLCSSStyleDeclaration::backgroundColor property.

image (none)

Any of the range of image values available to the IHTMLCSSStyleDeclaration::backgroundImage property.

repeat (repeat)

Any of the range of repeat values available to the IHTMLCSSStyleDeclaration::backgroundRepeat property.

attachment (scroll)

Any of the range of attachment values available to the IHTMLCSSStyleDeclaration::backgroundAttachment property.

position (0% 0%)

Any of the range of position values available to the IHTMLCSSStyleDeclaration::backgroundPosition property.

String format

[ <color> || <image> || <repeat> || <attachment> || <position> ]

CSS information

Applies ToAll elements
Mediavisual
Inheritedno
Initial Value(see individual properties)

Standards information

Remarks

The IHTMLCSSStyleDeclaration::background property is a shorthand property. Separate properties can be used to specify each property, but in many cases it is more convenient to set them in one place using this shorthand property.

Individual background properties not set by the composite background property are set to their default values. For instance, the default value for image is "none". Setting "background: white" is equivalent to setting "background: white none repeat scroll 0% 0%". So, in addition to setting the background color to white, setting "background: white" clears any image, repeat, attachment, or position values previously set.

The background properties render in the object's content and padding; however, borders are set using the IHTMLCSSStyleDeclaration::border properties.

Although objects do not inherit the IHTMLCSSStyleDeclaration::background property, the background image or color of an object's parent appears behind an object if a background is not specified.

For more information about supported colors, see the Color Table.

Starting in Windows Internet Explorer 9, the background of a box 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

 

 

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

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.