Philippe Wittenbergh wrote:
> We are talking about test 3
> <http://dev.l-c-n.com/margin_collapse/index.php>, Ok ?
> Here we have an empty div: <div class="clear"></div>. It is my
> understanding that such a div should not take up any space,
> and should not be taken into the count for the computed values
> of the margins. In this case, the only margin values that
> matter are the ones for the floated div and the non-floated
> div. On my Mac Safari, IE mac and Mozilla 1.8a2 all seem to agree,
> displaying a distance of 25px between the floated div and the
> non-floated div. For the sake of exercise, I made another test file
> where I put 10 such empty divs in a row. All 3 browsers still agree
> with each other.
My Safari shows a 50px distance here. But it is an older version than yours:
Seems a further proof that your interpretation is correct, and mine wrong :)
> The positioning of those divs according to the DOM Inspector is only
> slightly puzzling: x:33px (that is OK) and y:217px, before the first
> floated div. But then, it does have 0px margins, and within the clear
> model, I think it makes sense : extending the top-margin to clear all
> floats in the stack. The (red) blinking shown by the DOM Inspector is
> the marginbox.
Yes, what the DOM Inspector shows is the margin box. But what I would expect
to see with it here, is something similar to what it displays when the
clearing div is not empty, i.e. the clearer located after the last float.
Now the clearer should take no space, but it should still stay there, not
move before the first float. There should be a 'clearance' space that holds
it there (a sort of extension of its top-margin.) And there should be no
possibility for the margin of the following div to 'pass' through the
clearer, because of this 'clearance' that holds it there, and it is not
something which allows collapsing. But this interpretation is probably
wrong, so I'm going to stop thinking about it...
List wiki/FAQ -- http://css-discuss.incutio.com/
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/