Aracılığıyla paylaş


backgroundOrigin property

Specifies the positioning area of an element or multiple elements.

 

Syntax

Integer value = object.put_backgroundOrigin( v);Integer value = object.get_backgroundOrigin(* sPosition);

Property values

Type: BSTR

The position of the box or boxes.

padding-box (padding-box)

Initial value. The position is relative to the padding box. For single boxes, "0 0" is the upper-left corner of the padding edge; "100% 100%" is the lower-right corner.

border-box (border-box)

The position is relative to the border box.

content-box (content-box)

The position is relative to the content box.

String format

padding-box | border-box | content-box

CSS information

Applies To All elements
Media visual
Inherited no
Initial Value padding-box

Standards information

Remarks

For elements rendered as a single box, the IHTMLCSSStyleDeclaration::backgroundOrigin property specifies the background positioning area. For elements rendered as multiple boxes (for instance, inline boxes on several lines or boxes on several pages), this property specifies which boxes determine the background positioning areas.

If the IHTMLCSSStyleDeclaration::backgroundAttachment value for an image element is "fixed", then the IHTMLCSSStyleDeclaration::backgroundOrigin property has no effect. In this case, the background positioning area is the initial containing block.

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.

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.

As of Internet Explorer for Windows Phone 8.1 Update, Internet Explorer for Windows Phone supports "-webkit-background-origin" as an alias for this property.

Requirements

Minimum supported client

Windows Vista with SP1, Windows 7

Minimum supported server

Windows Server 2008 R2

Header

Mshtml.h

IDL

Mshtml.idl

DLL

Mshtml.dll

See also

Reference

IHTMLCSSStyleDeclaration::backgroundColor

IHTMLCSSStyleDeclaration::backgroundImage

IHTMLCSSStyleDeclaration::backgroundRepeat

IHTMLCSSStyleDeclaration::backgroundAttachment

IHTMLCSSStyleDeclaration::backgroundPosition

IHTMLCSSStyleDeclaration::backgroundClip

IHTMLCSSStyleDeclaration::backgroundSize

IHTMLCSSStyleDeclaration::background