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

backgroundRepeat property

Specifies whether and how the background image (or images) is tiled.

CSS 2.1, Section 5.3.4

Syntax

Integer value = object.put_backgroundRepeat( v);Integer value = object.get_backgroundRepeat(* sRepeat);

Property values

Type: BSTR

repeat (repeat)

Default. Image is repeated horizontally and vertically.

repeat-x (repeat-x)

Image is repeated horizontally.

repeat-y (repeat-y)

Image is repeated vertically.

inherit

no-repeat (no-repeat)

Image is not repeated.

String format

repeat-x | repeat-y | [ repeat | space | round | no-repeat ] {1,2} [ , repeat-x | repeat-y | [ repeat | space | round | no-repeat ] {1,2} ]*

CSS information

Applies ToAll elements
Mediavisual
Inheritedno
Initial Valuerepeat

Standards information

Remarks

The repeat-x and repeat-y values make the image repeat horizontally and vertically, respectively, creating a single band of images from one end to the other.

This property can be set with other background properties by using the IHTMLRuleStyle::background composite property.

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

Examples

The following example uses the repeat-y keyword to tile an image vertically.


body {
  background: lightgray url("fencing.png");
  background-repeat: repeat-y;
  background-position: center;
}

The following example uses the space keyword to tile an image so that it covers the entire body element, with each image equally spaced from one another.


body {
  background-image: url(greendot.png) lightgray;
  background-repeat: space
}

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.