How do you add an image as a background using HTML?

Sabrina L

New member
Ok this is what is going on. I am a 9th grader and i have html web page design and i am trying to make a website at home. The only thing is i do not know how to add an image as a background. I know how to use just colors. So please help me! And if you could please dumb it down like its html for dummier lol.thanx!
 
So usually you use <body bgcolor="#xxxxxx"> to specify the color, right?

This time, instead, use <body background="imagename.jpg">

It's probably best to keep a background color, so until the background image loads, the visitor to the page sees the color you intended. This is especially true if you plan to use a dark background image and light text. If you don't specify the background color too, they won't see the text until your image loads! So you can use:

<body background="imagename.jpg" bgcolor="#xxxxxx">

PS - the background image will tile by default (so if it is small, you'll see them repeat over and over again all over the screen). I don't remember how to stop this using straight HTML, but if you want more information I can explain how to do it with CSS.
 
Back
Top