Specifies up to five separate background properties of an object.
Integer value = object.put_background( v);Integer value = object.get_background(* sBackground);
Type: BSTRup to five of the space-delimited Possible Values, in any order.
Any of the range of color values available to the IHTMLStyle::backgroundColor property.
Any of the range of image values available to the IHTMLStyle::backgroundImage property.
Any of the range of repeat values available to the IHTMLStyle::backgroundRepeat property.
Any of the range of attachment values available to the IHTMLStyle::backgroundAttachment property.
position (0% 0%)
Any of the range of position values available to the IHTMLStyle::backgroundPosition property.
|Applies To||All elements|
|Initial Value||(see individual properties)|
- CSS Backgrounds and Borders Module Level 3, 3.10
- CSS 2.1, Section 5.3.7
- Document Object Model (DOM) Level 1 Specification, Section 2.5.5
The IHTMLStyle::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 IHTMLStyle::border properties.
Although objects do not inherit the IHTMLStyle::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 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
Minimum supported server
|Windows Server 2003|
Build date: 11/12/2012