H I O X INDIA
FREE ADVANCE HTML Tutorial
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Directories 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)   Bookmarks :-)  
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

HTML Basic
Introduction
How To
HTML Tags
html, head, body
Text Manipulation
IMAGES
Special Effects
Using Tables
Forms
Other Topics

ADVANCED HTML
Introduction
Media
Meta Tag
Frame tags
Fieldset
Tooltip
DTD
Image tags
Subscript & Superscript
Bullet styles
Canvas
Other tags
Ask Your Doubts
Feedback





HTML Body Background Image


Topic

How to set background image in html web page?



Explanation

background:
This is an attribute for body tag used for setting image or picture as a background.
<body background="./test.jpg">
</body>

The value for the attribute is the path of the image file.
In this example we have a image file named test.jpg in the same directory of the html file, so we use the path as ./test.jpg
It is mainly used when we want a common background a lines/stripes etc.
The image in our example, test.jpg is a very small one as shown here
So a very small image can be used to set the background of such a big page

Combining all the tags learned so far
Code:
<html>
<head>
<title> My Page
</title>
</head>

<body bgcolor="green" background="./test.jpg">
This is my first page </body>
</html>

Test It:
Copy the code or type the code in to the textbox shown under subtopics and click show.
Such a kind of background occur because when the image size is small it will be placed again next to it, until the size reaches the total height and width of the screen.




others


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

Other Links