Static background picture using a div
Goal: use a picture backgroud that will work realy nicely.
1. We need some HTML to put the picture in. Make sure your code is at the top of your page.
<div id="bg"> <img src="yourpicture.jpg" alt=""> </div>
2. We use a little css to make it work.
#bg { position: fixed; top: -50%; left: -50%; width: 200%; height: 200%; } #bg img { position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: auto; min-width: 50%; min-height: 50%; }