I am trying to stretch a background image to fit 100% of the page, I can do it when it's not a background image with the code below but how do I set it as a background image of 100%? Thanks. I keep seeing z-index, wtf is that? Thanks.
[html] #background {margin:0px;width:100%; height:100%; background-image:url("concrete2.jpg"); background-position:center; bgcolor:#000;}
#background img {width:100%; height:100%;}[html]
Unfortunately you are going the wrong way. The way you try to do it is wrong from the beginning.
1. I assume you are trying to set background to a DIV tag with the ID="background". The way you've made your #background definition, your css sets a background image for your DIV element, which cannot be accessed using an img definition in your css.
2. Your #background img definition however does not control the image for your background as well. The way the browser reads your second definition is something like this
"Set width and height for any image contained in the object with id="background" to this width and height", however you expect and want to make the browser read it this way:
"Set background image for object with ID=background to this width and height".
Unfortunately background image size cannot be controlled by css. These are your only options:
http://w3schools.com/css/css_reference.asp
Check the background section for full description and browser support.
You still can make it work the way you want, however you will end up in very complex absolute positionning on your page, that will make it a complete mess.
Still if you want to try to solve it, you can make 2 div elements. Set Z-index for your #background to be 2, position: absolute, top: 0, left: 0; width: 100%; height: 100%; for your #background img element should be smth like this width: 100%; height; 100%; and for your other div e.g. id="content" set z-index=1; position: absolute; top: 0; left: 0;
The code should be approx like this:
[html]
<div id="background" style="z-index: 2; position: absolute; top: 0; left: 0; width: 100%; height: 100%;">
<img src="your_image.jpg" style="height: 100%; width: 100%;" />
</div>
<div id="content" style="z-index: 1; position: absolute; top: 0; left: 0; width: 100%; height: 100%;> ENTER YOUR CONTENT HERE </div>[/html]
Hope it will work for you.