CSS Background-repeat Property

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]

Example

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!

Post comment

Links that you insert are not nofollowed, but will be removed by admins if they are considered spam.

[url=Absolute URL for page]TITLE[/url]

You should insert code boxes around code examples, which will be automatically syntax highlighted.

[code1 html|css|javascript|php|sql]Your Code Here[/code1]

You may want to read our Privacy Policy before submitting your comment.