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]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.