H I O X INDIA
FREE CSS Tutorial
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Directories 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)   Bookmarks :-)  
Español  Français  中文  Deutsch 
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

CSS Topics
Introduction
Types
Background Properties
Text Properties
Font Properties
BOX Properties
Border Properties
Margin Properties
Padding Properties
Special Topics
Ask Your Doubts
More about CSS
Feedback




CSS Background Repeat


Topic

How to set the background image with out repeating in html?
I want background image to repeat in vertical direction only?
I want background image to repeat in horizontal direction only?



Explanation

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.
a)repeat : This value tells the image to be repeated in both directions
b)repeat-x : This value tells the image to be repeated in vertical direction only
c)repeat-y : This value tells the image to be repeated in horizontal directions
d)no-repeat : This value tells that the background image should not be repeated

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

Result:
color name





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

Result:
color name





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

Result:
color name





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

Result:
color name





Now you can see that the image has been set as background for the div tag.
Depending on the repeat tag the image gets itself repeated inside the space.






A Note
CSS - Cascading Style Sheets can be used along with html tags as explained in this site. This simple CSS will help you to create much elegant and neat html web pages. This does not need any additional softwares or codings. All web browser are capable of handing CSS codes.

Note 2: If required you can using <span> instead of <div> tags. div tag will start and end on new lines. span will not exceed the tag area.


privacy policy     license     sitemap
© 2004-2005 HIOX INDIA - hioxindia.com