IHTMLRuleStyle7::backgroundSize Property

New for Internet Explorer 9

[This documentation is preliminary and is subject to change.]

Gets or sets the size of the background images.

Syntax

HRESULT IHTMLRuleStyle7::get_backgroundSize(BSTR *sSize);
HRESULT IHTMLRuleStyle7::put_backgroundSize(BSTR v);

Parameters

  • sSize
    Pointer to a variable of type BSTR that receives one of the values listed in Possible Values.
  • v
    BSTR that specifies one of the values listed in Possible Values.

Possible Values

auto Default. See Remarks.
contain Scale the image, while preserving its intrinsic aspect ratio (if any), to the largest size such that both its width and its height can fit inside the background positioning area.
cover Scale the image, while preserving its intrinsic aspect ratio (if any), to the smallest size such that both its width and its height can completely cover the background positioning area.
length A floating-point number, followed by an absolute units designator (cm, mm, in, pt, or pc) or a relative units designator (em, ex, or px). For more information about the supported length units, see the CSS Length Units Reference.
percentage An integer, followed by a percent (%). A percentage value is relative to the background positioning area.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

An auto value for one dimension is resolved by using the image's intrinsic ratio and the size of the other dimension. If either of these values is not available, the image's intrinsic size is used. If the image's intrinsic size is not available, it is assigned the value of 100%. If both values are auto, use the intrinsic width, height, or both, of the image. If the image has neither an intrinsic width nor an intrinsic height, its size is determined as for contain.

Negative values are not allowed.

See Also

IHTMLStyle::backgroundColor, IHTMLStyle::backgroundImage, IHTMLStyle::backgroundRepeat, IHTMLStyle::backgroundAttachment, IHTMLStyle::backgroundPosition, IHTMLRuleStyle7::backgroundClip, IHTMLRuleStyle7::backgroundOrigin, IHTMLStyle::background