Background Repeat Using CSS



The CSS background-repeat property is used to define how the background image repeats itself.

Syntax

The syntax of CSS background-repeat property is as follows −

Selector {
   background-repeat: /*value*/
}

Example

The following examples illustrate CSS background-repeat property −

 Live Demo

<!DOCTYPE html>
<html>
<head>
<style>
body {
   background-image: url("https://www.tutorialspoint.com/images/microsoftproject.png");
   background-repeat: repeat;
}
</style>
</head>
<body>
</body>
</html>

Output

This gives the following output −

Example

 Live Demo

<!DOCTYPE html>
<html>
<head>
<style>
ul {
   background-image: url("https://www.tutorialspoint.com/images/questions-answers.png");
   background-repeat: space repeat;
}
</style>
</head>
<body>
<h2>Tutorials</h2>
<ul>
<li>Java</li>
<li>C#</li>
<li>Etherum</li>
<li>DBMS</li>
<li>OS</li>
</ul>
</body>
</html>

Output

This gives the following output −


Advertisements