W3C home > Mailing lists > Public > www-style@w3.org > September 2007

RE: "non-zero top border" in 8.3.1

From: Alex Mogilevsky <alexmog@exchange.microsoft.com>
Date: Thu, 6 Sep 2007 13:34:46 -0700
To: Ian Hickson <ian@hixie.ch>
CC: "L. David Baron" <dbaron@dbaron.org>, "www-style@w3.org" <www-style@w3.org>
Message-ID: <04F36FB4ED0F85459AA447F72711526FFFE8360DA4@DF-GRTDANE-MSG.exchange.corp.microsoft.com>

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>
         </div>
       </div>
     </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 (8.3.1.6.2)
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" (8.3.1.6.1)
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:52 GMT