background image fit different resolutions?

Ines

New member
Hi!

I was searching about how to make a background image fit different resolutions in html, and I found this:


<div id="background">
<img src="img.jpg" class="stretch" alt="" />
</div>
with the following css:
#background {
width: 100%;
height: 100%;
position: absolute;
left: 0px;
top: 0px;
z-index: 0;
}

.stretch {
width:100%;
height:100%;
}


my questions are:

It’s necessary to write <html> in the beginning and end, for this to work?

Where do I put my information? What do I need to change besides the “img.jpg"?

In the <img src="img.jpg" class="stretch" alt="" /> it’s necessary to write something between the ""?

Tks.
 
Back
Top