John Horner wrote:
 * floated elements too big for the enclosing element "spill out"
 * except on IE, where they stretch the enclosing element

that's a bit simplified, but essentially correct, right?

Right.

For instance, with this code:

<div style="width:300px;height:100px;border:1px solid black;">
  DIV A
    <div style="width:100px;height:300px;border:1px solid red;float:left;">
      DIV B
    </div>
</div>

DIV B will overlap DIV A and continue down the page on its own unless
 you're in IE in which case A will stretch.

Why limit it to floats? The same will/should happen to non-floats also.

My question is, *why* is the correct behaviour the first one? It takes a lot of people by surprise and they often see what IE does as the natural and obvious thing to do.

- div A has dimensions and they should be respected, - no matter the size of the content: div B, - except in IE/win, where we need workarounds.

A standard-compliant browser will let us choose if we want the container
to expand, or not. No height, or min-height only, on div A, and it will
behave as in IE/win across browserland. So, we are given alternatives.

IE/win has only one alternative: expand containers until the content
fits inside. Logical for a weak browser, but "not much" for a web designer.

Workaround in IE/win: http://www.gunlaug.no/contents/wd_1_02_02.html
... do the calculations that IE/win don't master.

regards
        Georg

******************************************************
The discussion list for  http://webstandardsgroup.org/

See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************



Reply via email to