Forum Moderators: not2easy
This code produces different results in IE and netscape. I would like the outer div to conserve the border like IE does without seting the height attribute.
Thanks a lot
<div style="position:relative; top:10px; left:10px; width:100px; border:1px solid black">
<div style="float:left; width:90px; height:90px; background-color:blue;"></div>
<div style="float:left; width:90px; height:90px; background-color:red;"></div>
</div>
Another way to fix it would be to add an element(div) after the second floated div and set it's style to: 'clear: both;'.
Floated elements are taken out of the document flow, therefore not accounted for when the container element height is calculated. In other words, if you only have floating elements inside a container, the browser will treat the container like it is empty(hence the missing background colors and borders).
Birdman