HTML Dog

Skip to navigation

CSS Property: background-repeat

How a background image will repeat itself within a box.

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. Not widely supported.
roundImages repeat but are not clipped. Each instance stretches to fill the background area until a new instance can fit in. Not widely supported.
[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. */