H I O X INDIA
FREE CSS Tutorial
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Directories 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)   Bookmarks :-)  
 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
Feedback





CSS Background Image


Topic

How to set a background image in html using css?




Explanation

Property: BackGround Image

Usage:
background-image: url('image.jpg');
background-image: none;

Definition:
Background image can be set using the tag background-image. It takes the image in url as said in the example.
a)url("image directory"). We have to set the image path inside the tag url. It accepts either of the given values.
b)none, if no background image is required.

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

Result:
color name




Example 2:
<font style="background-image: none; background-color: green; "> color using hex values <br><br><br><br></font>

Result:
color using hex values


Now you can see that the image has been set as background for the div tag.
As none is set for font tag (example 2). Nothing shows up there.






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