CSS background-repeat Property Example

Updated on     Kisan Patel

The CSS background-repeat property defines how background images are repeated.

A background image can be repeated along the horizontal axis, the vertical axis, both axes, or not repeated at all.

Syntax

background-repeat: repeat|repeat-x|repeat-y|no-repeat;

where,

  1. repeat-x will repeat the background image horizontally.
  2. repeat-y will repeat the background image vertically.
  3. no-repeat will not be repeat background image.

Example

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


CSS

Leave a Reply