The background-repeat
CSS property sets how background images are repeated. A background image can be repeated along the horizontal and vertical axes, or not repeated at all.
Default value repeat
The image is repeated as much as needed to cover the whole background image painting area. The last image will be clipped if it doesn't fit.
no-repeat
The image is not repeated (and hence the background image painting area will not necessarily be entirely covered). The position of the non-repeated background image is defined by background-position
(./background-position).
repeat-x
Repeat along x-axis.
repeat-y
Repeat along y-axis.
space
The image is repeated as much as possible without clipping. The first and last images are pinned to either side of the element, and whitespace is distributed evenly between the images. And background-position
(./background-position) is ignored.
round
As the allowed space increases in size, the repeated images will stretch (leaving no gaps) until there is room (space left >= half of the image width) for another one to be added.
The rendering behavior of the space
and round
keywords is actually the same as that of repeat
.
Initial value | repeat |
Applies to | all elements |
Inherited | no |
Animatable | no |
inherit
LCD tables only load in the browser