Set a background-image to no-repeat:
The backgroundRepeat property sets or returns how to repeat (tile) a background-image.
The backgroundRepeat property is supported in all major browsers.
Return the backgroundRepeat property:
Set the backgroundRepeat property:
Value | Description |
---|---|
repeat | The background image is repeated both vertically and horizontally. This is default |
repeat-x | The background image is only repeated horizontally |
repeat-y | The background image is only repeated vertically |
no-repeat | The background-image is not repeated |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Default Value: | repeat |
---|---|
Return Value: | A String, representing how a background-image is repeated |
CSS Version | CSS1 |
Change the backgroundRepeat property of a specified DIV element:
Set a background-image to repeat horizontally or vertically:
Return the background-repeat value of a document:
CSS tutorial: CSS Background
CSS reference: background-position property
CSS reference: background-repeat property
HTML DOM reference: background property