codescracker


css

CSS Background Repeat



« Previous Tutorial Next Tutorial »


The background-repeat Property

The background-repeat property allows you to tile the background images along x-axis and y-axis of an element.

Note - The background-repeat property is used along with the background-image property only.

The background-repeat property can take either of the following values:

Repeat Background Image Horizontally or Vertically

By default, the background-image property repeats an image both horizontally and vertically.

To make background image to repeat horizontally, then below is the syntax:

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

To make background image to repeat vertically, then below is the syntax:

body
{
	background-image: url("bg_image.jpg");
	background-repeat: repeat-y;
}

Background Image no-repeat

Showing the image only once is specified by the background-repeat property:

body
{
	background-image: url("bg_cloud_once.png");
	background-repeat: no-repeat;
}

« Previous Tutorial Next Tutorial »



Tools
Calculator

Quick Links
Signup - Login - Give Online Test