RE: "non-zero top border" in 8.3.1

I think I now understand what the spec expects...

I removed the floats from the example to make it smaller. Even though floats aren't there, the positions must be defined. With floats it would look like this:

     <div class="block">
       <div class="nothing">
         <div style="float:left">A</div>
         <div class="topMargin">
           <div style="float:left">B</div>

What looked as a contradiction in the rules is explained by your answer to Q3. The logic as I understand it now is

1) Position of "nothing" is exactly as what it would be if it had a top border (
2) Margins of "topMargin" don't affect position of its parent "nothing" (because of "top border" rule)
3) "topMargin" is still aligned with "nothing" because its top margin collapses with tom margin of "nothing" (
4) result of collapsing margins of "topMargin" and "nothing" have no effect on position of either

Now that I understand the spec, can you explain why this behavior is preferable to what Firefox and Safari are doing? They put any empty element exactly at the same position where it would be if it wasn't empty (as long as adding content doesn't prevent its top margin from collapsing with any children). That has continuity, and  it is more intuitive (at least for me). If the spec says otherwise there must be a strong reason - what is it?

(note that I don't point at IE or Opera's behavior; they are incompatible with other parts of margin collapsing, and not in the same way; Firefox and Safari seem to be both interoperable and compatible with all of margin collapsing, except this one rule of "top border")

Received on Thursday, 6 September 2007 20:35:01 UTC