Forum Moderators: not2easy
Here a brief version of the code:
html
<div id="container">
<div class="content">
dynamic content
<br />
dynamic content
<br />
dynamic content
<br />
dynamic content
<br />
dynamic content
<br />
dynamic content
<br />
</div>
<div id="bottomline">
</div>
</div>
css
#container{position:absolute;top:0px;left:0px;padding:0px 0em 0px 0px;margin-left:0px; margin-top:0px; border:0px ; width:350px; height:240px;}
#bottomline{position:absolute;bottom:0px;left:0px;padding:0px 0em 0px 0px;margin-left:0px; margin-top:0px; border:0px ; width:350px;height:19px;}
.content{has font classes etc.}
I noticed that you have position:bottom which I believe is an IE-only extension and not valid W3C CSS. Well, I got this code to work using a different kluge, the ever-dreaded spacing div with a margin on .content to push #bottomline out of the way.
The borders are just to show where the boxes are drawn, and you'll also need to account for IE's incorrect calculation of widths and heights, but I think this is what you're looking for:
<style type="text/css">
#container, #bottomline {position:absolute; left:0; padding:0; margin:0; width:350px}
#container {top:0; border: 1px solid #c00;}
#bottomline {bottom:0; border: 1px solid #009;height:19px;}
#spacer {height:240px; float:right;}
.content {font-size: 1em; margin-bottom:1.5em}
</style><div id="container">
<div id="spacer"><br /></div>
<div class="content">
dynamic content<br />
dynamic content<br />
</div>
<div id="bottomline"></div>
</div>
I've been on a computer-free holiday(strange but true),so it's taken me a while to come back to this topic.
I haven't managed to solve my problem with the spacer div in your example.
As the site-layout is complicated, with a lot of nested divs with relative and absolute positions, the problem probably lies in the relationship between these nested divs to each other.
Everything else works, so I'm not really willing to change them.
One interesting result cropped up whilst removing comments from a division:
<div id="container">
<div id="top-bar">
</div>
<div id="content">
<div class="subdivision">
dynamic content
</div>
<div class="subdivision">
dynamic content
</div>
<div class="subdivision">
dynamic content
</div-->
</div>
I removed the!-- starting the comment, but neglected to remove the -- in the closing tag.
As the closing tag was then no longer recognised as such, the next one was taken to close the subdivision, and so the content division with the height property in it's CSS had no closing tag.
Mozilla then oddly enough accept's the height as a minimum-height, and explorer as usual generously overlooks the tag mistake and so retains the absolute height property it needs!
I don't really want to go with this, but it does seem to work!
I've decided to solve the problem with a type of spacer div with a height property which is thrown out when the php-generated content length exceeds that height.
Probably the safest solution.
Thanks again for your help,
Oona
>>position: absolute; bottom is a correct setting
top¦bottom¦left¦right are all legitimate position properties
Your problem is easily sorted with min-height whcich unfortuantely isn't supported in IE.. but as you've discovered IE already renders the code how you want anyway as it stretches the div greater than the specified height if required.
So it can be done by feeding IE a height value and everyone else a min-height value
CSS:
#container{
position:absolute;
top:0px;
left:0px;
padding:0;
margin:0;
border:0px ;
width:350px;
min-height:240px;
}* html #container {height: 240px;}
#bottomline{
position:absolute;
bottom:0px;
left:0px;
padding:0;
margin:0;
border:0;
width:350px;
height:19px;
background: red; /* added for testing */
}
The * html is a workaround/hack that will feed a value to IE only
Suzy