Style backgroundRepeat property
The Style object
Definition and Usage
The backgroundRepeat property sets or returns how a background image is repeated.
Syntax
Set the backgroundRepeat property:
Object.style.backgroundRepeat="repeat|repeat-x|repeat-y|no-repeat|inherit"
Return the backgroundRepeat property:
Object.style.backgroundRepeat
| Value | Description |
|---|---|
| repeat | Default. The background image is repeated both vertically and horizontally. |
| repeat-x | The background image is repeated horizontally. |
| repeat-y | The background image is repeated vertically. |
| no-repeat | The background image is not repeated. |
| inherit | The background-repeat property is inherited from the parent element. |
Browser support





All major browsers support the backgroundRepeat property.
**Note:** IE7 and earlier versions do not support the "inherit" value. IE8 supports "inherit" only if a !DOCTYPE is specified. IE9 supports "inherit".
Example
Example
Set the background image to repeat vertically:
Hello World!
This is a paragraph
Try it »
The Style object