The background-repeat property defines how background images are repeated. A background image can be repeated along the horizontal axis, the vertical axis, both, or not repeated at all.

  • Initial valuerepeat
  • Applies toAll elements
  • InheritedNo
  • MediaVisual
  • Computed valueA list, each item consisting of: two keywords, one per dimension
  • AnimatableNo
  • CSS VersionCSS1, CSS2, CSS3
  • JavaScript
Formal syntax: <repeat-style> [ , <repeat-style> ]* 

background-repeat: repeat-y;
background-repeat: repeat-x;
background-repeat: repeat;
background-repeat: no-repeat;
background-repeat: space;
background-repeat: round;
<repeat-style> = repeat-x | repeat-y | [repeat | space | round | no-repeat]{1,2}
  • repeatThe image is repeated horizontally and vertically. In CSS3, if two keywords are used, the image is repeated along the relevant axis.
  • repeat-xThe image is repeated along the horizontal axis.
  • repeat-yThe image is repeated along the vertical axis.
  • no-repeatThe image is not repeated.
  • spaceThe image is repeated as often as will fit into the background area a whole number of times, and is spaced out so that the first and last ones touch the edges. (CSS3)
  • roundThe image is repeated as often as will fit into the background area, and is rescaled if necessary to make it fit a whole number of times. (CSS3)
  • inherit
.class {
   background-image: url(/img/myimage.jpg);
   background-repeat: no-repeat;
   background-position: 30% 80%;

Click the button below to experiment with this property.

Give it a Try!


Last updated on 23rd March 2014 By Rene Spronk

View All CSS Properties

Errors? Please help to keep this list up to date, If you find any errors, please contact us, so that we can get them fixed.