fusioninternet
asked on
CSS align image to the bottom of a variable height page
I have web template that requires an image to aligned to the bottom of the page, the issue i am having is depending on the content of the page the position of the image will need to move to remain aligned bottom.
----code---
#container { position:relative; width: 800px; margin:0px auto; padding: 0px; background-color:#030201; }
#main { width: 100%; padding-bottom: 10px; background-color:#ffce7b; }
<div id="container">
<div id="main">text, images, page content etc</div>
<div style="position:absolute; top:0px; left:0px; width:300px; height:100%; background:url(images/crow n_logo.png ) bottom no-repeat; z-index:400;"></div>
</div>
--------
This example will work fine if i put in a fixed height, but i really want the to be able to use the height:100% so the image is positioned relative to the container div
any help is greatly appreciated
Justin
----code---
#container { position:relative; width: 800px; margin:0px auto; padding: 0px; background-color:#030201; }
#main { width: 100%; padding-bottom: 10px; background-color:#ffce7b; }
<div id="container">
<div id="main">text, images, page content etc</div>
<div style="position:absolute; top:0px; left:0px; width:300px; height:100%; background:url(images/crow
</div>
--------
This example will work fine if i put in a fixed height, but i really want the to be able to use the height:100% so the image is positioned relative to the container div
any help is greatly appreciated
Justin
ASKER
Thanks for the info, but i'm more after someone to see where i am going wrong in my code.
The issue is that i need an image to always be at the bottom of a containing div, the image i am using is a transparent png and overlays the content
The code causing the problem is:
<div style="position:absolute; top:0px; left:0px; width:300px; height:100%; background:url(images/crow n_logo.png ) bottom no-repeat; z-index:400;"></div>
If i change the attribute height:100% to a fixed pixel height (height:400px for example then the item aligns at the bottom of the 400px containing div, the issue is that the height changes on every page due to the content of the page changing the depth of the page.
If i use the attribute height:100% then the browser just renders a small div that is a few pixels deep, not to the height of the parent div.
Regards
Justin
The issue is that i need an image to always be at the bottom of a containing div, the image i am using is a transparent png and overlays the content
The code causing the problem is:
<div style="position:absolute; top:0px; left:0px; width:300px; height:100%; background:url(images/crow
If i change the attribute height:100% to a fixed pixel height (height:400px for example then the item aligns at the bottom of the 400px containing div, the issue is that the height changes on every page due to the content of the page changing the depth of the page.
If i use the attribute height:100% then the browser just renders a small div that is a few pixels deep, not to the height of the parent div.
Regards
Justin
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://www.dynamicdrive.com/style/layouts/category/C9/
is there is anything close to your purpose. Sorry.