HTML Dog
Skip to navigation

CSS Property: background-repeat

How a background image will repeat itself within a box.

background-position: top right combined with background-repeat: no-repeat.

Possible Values

ValueDescriptionExample
repeatTiled. Repeating the image both horizontally and vertically. Default behavior.
repeat-xRepeating the image horizontally only.
repeat-yRepeating the image vertically only.
no-repeatNot repeating the image at all, showing just one instance.
spaceImages repeat but are not clipped. A uniform gap spaces out each instance until a new instance can fit in.
roundImages repeat but are not clipped. Each instance stretches to fill the background area until a new instance can fit in.
[value], [value]For multiple backgrounds. Values separated by commas correspond to multiple images separated by commas with background-image.repeat-x, repeat-y
inherit
initial
unset

Example


header { background-repeat: repeat-x; }
/* The background image of a header repeats horizontally but not vertically. */

Browser support