W3C home > Mailing lists > Public > public-css-testsuite@w3.org > November 2013

Re: Issue with margin-collapse-clear-012.htm and margin-collapse-clear-013.htm

From: Robert Hogan <robhogan@gmail.com>
Date: Wed, 6 Nov 2013 19:23:29 +0000
Message-ID: <CAD1xn+OwOUc7wEejo_Xby+y=zOE8cBxtqvvpJPodB0Tgg4suwg@mail.gmail.com>
To: Bruno Fassino <fassino@gmail.com>
Cc: Public CSS test suite mailing list <public-css-testsuite@w3.org>, Gérard Talbot <css21testsuite@gtalbot.org>
Hi Bruno,

So am I correct in understanding you to say that (1) regardless of the
margin-top/margin-bottom values on self-collapsing-with-clearance it's top
border edge should always be just after the float, (2) that when the
margins of self-collapsing-with-clearance collapse together they do so at
the position that is the computed value of the clearance from the top of
the float (in this case 140px), with the result that any subsequent
siblings use that clearance as their de-facto margin-top?

After playing with this a bit more I think the result in IE and FF is
because they are not collapsing margin-top and margin-bottom together. If
you play with the margins in web inspector you'll see what I mean. Changing
the negative margin-top value has no effect, while increasing the
margin-bottom pushes the subsequent sibling down further.

So maybe the answer is just to not treat the two margins as collapsing when
we have clearance?

Thanks,
Robert



On 28 October 2013 15:52, Bruno Fassino <fassino@gmail.com> wrote:

> On Mon, Oct 28, 2013 at 2:11 PM, Robert Hogan <robhogan@gmail.com> wrote:
>
>> HI Bruno,
>>
>> That seems sensible. However I'm having trouble making sense of the
>> case where negative margins are involved.
>>
>> <div id="parent">
>>   <div id="float" style="float:left; height: 100px; width: 100px;
>> background-color:blue;"></div>
>>   <div id="self-collapsing-with-clearance" style="clear: both;
>> margin-top: -40px; margin-bottom:40px;"></div>
>>   <div id="following-sibling">Text</div>
>> </div>
>>
>> FF and IE both render the 'Text' 40px below the float. Can you help me
>> understand why?
>>
>
>
> Following the same lines as before, I believe that here a clearance of
> 140px is needed to put the top border edge of
> self-collapsing-with-clearance just after the float. The margins of
> self-collapsing-with-clearance collapse to zero and its margin edge (both
> top and bottom) is 40px below the float (the top border edge is "outside" /
> higher than the margin edge).
> following-sibling the starts at 40px below the float.
>
> Bruno
>
>
Received on Wednesday, 6 November 2013 19:23:56 UTC

This archive was generated by hypermail 2.4.0 : Friday, 20 January 2023 19:58:20 UTC