Position: Bottom Issues
January 22, 2007 5:41 PM
Subscribe
CSS/HTML/Javascript: I cannot get all browsers to obey my wishes regarding the placement of my absolutely positioned footer.
I cannot link to my dev page because of non-disclosure issues, but hopefully this description will suffice.
Code model, with relevant bits:
<html>
<div id="container" style="min-height: 100%">
<div id="footer" style="bottom: 0">
</div>
</div>
</html>
One page has a file tree, with javascript used to show/hide the branches of the tree. When a branch is expanded, if the 'container" div then exceeds its min-height, Firefox correctly adjusts the position of the footer to the bottom of the div. IE 6 & 7 do not, leaving the footer right where it was, now hanging in the middle of the div (once you scroll, anyway, if that makes sense). In my javascript function, I was able to "fix" that by (simplifying):
style.footer.bottom = ';
style.footer.bottom = '0';
Alas, this trickery does not make Safari play nice--it still displays the hanging footer.
Is there a better way to approach this? Or is there a Safari-specific "hack" I can introduce to get it to realize that the container div's bottom has changed?
posted by maxwelton to computers & internet (13 comments total)
1 user marked this as a favorite
posted by maxwelton at 5:44 PM on January 22, 2007