This is more of a philosophical question than a technical question, but here's the background. As we probably all know:

 * 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?

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.

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.

I'm not trying to start a flame war, I really want to know!

I looked at my copy of the O'Reilly Definitive Guide by Eric Meyer and it just says that it's the correct behaviour, although some browsers don't respect it. It doesn't offer a rationale.

------------------------------------------------------------
               "Have You Validated Your Code?"
John Horner                            (+612 / 02) 9333 3488
Senior Developer, ABC Online          http://www.abc.net.au/
------------------------------------------------------------
******************************************************
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