CSS background-repeat property

Usage

Specifies whether or not the background should repeat, and if so, how it should repeat.

Values

  • repeat - the background image will repeat both horizontally and vertically
  • repeat-x - the background image will repeat horizontally but not vertically
  • repeat-y - the background will repeat vertically but not horizontally
  • no-repeat - the background will not repeat

Example

Code:

body {
  background-image: url(background.jpg);
  background-repeat: repeat-x;
}