Click to See Complete Forum and Search --> : HTML - Image as background


lontana
November 9th, 2006, 05:48 AM
Dear Gurus,
How can I put my image to serve as a background for my HTML page?
Thankfully

Hobson
November 9th, 2006, 06:13 AM
Use <body background="path/to/image"> ... </body>

HanneSThEGreaT
November 9th, 2006, 07:38 AM
Yes, Hobson's way will definitely work! :)

Just a few notes on adding Background pictures :
Don't use Background pictures that are large, and take a long time to download
Don't use Background pictures, which might interfere with your Body's text, use contrasting colors
use colors wisely
Don't use Animated GIF files as a background

If the background picture is small, the browser will tile it automatically for you.
With the use of CSS (Cascading Style Sheets) you can set the background repeat property to x or y, depending on how you want the picture to be tiled. With CSS, also, you can put a fixed background (which will scroll along with the body text)

PeejAvery
November 9th, 2006, 08:36 AM
I know this has been adequitely answered, but to add a little more about CSS. CSS is an amazing thing. In fact, it has the most versatile control over HTML. I would suggest that route rather than background=...

Take a look at this example and this link (http://www.w3schools.com/css/css_reference.asp).
<style>
body{
background: short overall;
background-color: #HEXCOLOR;
background-image: url(path/image.jpg);
background-repeat: repeat direction or not;
background-attachment: fixed or scroll;
background-position: where to start;
}
</style>

HanneSThEGreaT
November 9th, 2006, 08:50 AM
Well, seeing that from the big man himself (that's you Paul) (and big means great in this context), has said everything! Great post!!! :)

PeejAvery
November 9th, 2006, 10:03 AM
Haha. HTML and CSS are easy. Far from making me great. Thanks.