Link to home
Start Free TrialLog in
Avatar of fusioninternet
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/crown_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
Avatar of xberry
xberry
Flag of Germany image

not sure what you want to achieve, have a look there please
http://www.dynamicdrive.com/style/layouts/category/C9/
is there is anything close to your purpose. Sorry.
Avatar of fusioninternet
fusioninternet

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/crown_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
ASKER CERTIFIED SOLUTION
Avatar of xberry
xberry
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial