[thelist] Have I got my sums right?

Simon Perry simon.perry at si-designs.co.uk
Fri Nov 21 05:22:32 CST 2003


Chris Price wrote:

>A couple of weeks ago asked why my IE Win was folding my page and Simon
>Perry gave me some really useful hints but I'm not sure if I've solved the
>problem.
>
>I have 3 floating divs and the 3rd one is dropping below the other 2.
>
>I've added up the widths and I make the total to be 97% of the parent div.
>
>Are my sums right and will IE Win do what I want if they are?
>
>The page is: http://choctaw.co.uk/
>
>btw Is there a difference between IE on Win200 and WinME.
>
>  
>
Chris,

You have your sums right but IE 5x do not! You page has a margin of 20% 
leaving 80% for the choctaw div to use. Now Gecko based browsers, Opera 
7.2 and IE6 calculate the width of the floats from the width of their 
containing block (choctaw div, 29% of 80%...). Good  old IE 5x  however 
calculates the width of  the floats  from the  width of the viewport and 
therefore use 120% of the viewport before you even start applying 
padding, margins etc. Bump, down goes your right float. Time to apply 
some IE5 box model hacks [1] to feed smaller widths to those pesky IE5 
browsers.

Simon

[1] http://tantek.com/CSS/Examples/boxmodelhack.html
[1!] http://css-discuss.incutio.com/?page=BoxModelHack





More information about the thelist mailing list