Jump to content

fixed and stretched background not working


brem13

Recommended Posts

hey

im trying to make my site have a background picture on my site have a fixed position and have it stretch to the size of the window.

it makes the picture the background and stretches it to the size of the screen, but all the content that should be on it is underneath the picture (screenie below)

here is the code in my style.css

#bg_image {
width: 100%;
height: 100%;
left: 0px;
top: 0px;
position: absolute;
z-index: 0;
}
#contents {
position:absolute;
z-index:1;
}

here is the code after my body tag

echo "<div id=bg_image><img style='width: 100%; height: 100%;' src=\"$background\"></div><div id=contents>";

and before the end body tag

echo "</div>";

any help?

 

[attachment deleted by admin]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.