By using this site you agree to the use of cookies by Brugbart and our partners.

Learn more

CSS Background-repeat Property

Using the background-repeat property, to control how the background is repeated in an element.

Edited: 2015-02-21 15:02

The background-repeat property sets whether or not, and even how, a given background image should be tiled, or repeated if its smaller then its container.

Possible Values

  1. no-repeat
  2. repeat (Default)
  3. repeat-x [Repeats the image Horizontally]
  4. repeat-y [Repeats the image Vertically]


The following example first sets a background-image for body, and then how it should be repeated, (in this case only Horizontally).

body {
  background-image: url("MyImage.png");
  background-repeat: repeat-x;

Inherited? - NO!