Latest Post

Background Repeat

How to set the background image with out repeating in html?
Repeat background image in vertical direction only.
Repeat background image in horizontal direction only.


This tag sets the property of how the background image should look.
Depending on this tag the image might repeat in horizontal or vertical or both directions
It takes any of the following values.

1) repeat : This value tells the image to be repeated in both directions
2) repeat-x : This value tells the image to be repeated in vertical direction only
3) repeat-y : This value tells the image to be repeated in horizontal directions
4) no-repeat : This value tells that the background image should not be repeated

Example 1:

 <div style="background-image: url(earth.jpg'); background-repeat: repeat; background-color: green;"> color name   
 </div>  

Example 2:

 <div style="background-image: url('earth.jpg'); background-repeat: repeat-x; background-color: green;"> color name <br><br><br></div>  

Example 3:

 <div style="background-image: url('earth.jpg'); background-repeat: repeat-y; background-color: green;"> color name <br><br><br></div>  

Example 4:

 <div style="background-image: url('earth.jpg'); background-repeat: no-repeat; background-color: green;"> color name <br><br><br></div>