Re: [CSS21] Margin collapsing with negative margins

Le 2013-10-24 21:23, Sylvain Galineau a écrit :
> On 10/24/13 5:17 PM, "Gérard Talbot" <www-style@gtalbot.org> wrote:
> 
>> Hello,
>> 
>> In this test
>> 
>> http://www.gtalbot.org/BrowserBugsSection/css21testsuite/margin-collapse-n
>> egative-margins.html
>> 
>> why isn't there an orange gap of 1em (50px) separating the 2 blue
>> stripes?
>> 
>> I have examined this test from all angles. What am I missing?
>> 
>> Thanks, Gérard
> 
> Well, if one reads the definition you quote literally:
> 
>  "the maximum of the absolute values of the negative adjoining margins" 
> ->
> 2em (the absolute value of the -2em margin-top)
> 
> 
>  "the maximum of the positive adjoining margins." -> 2em (the
> margin-bottom of #child-of-first-parent)
> 
> 
>  "is deducted from" -> 2em-2em == 0em ?


Okay. I understand now where I have been wrong. When collapsing margins, 
I proceeded from innermost to outermost instead of proceeding in 
document source order, in the order in which margins appear with their 
respective elements.

Thank you for your reply, Sylvain. This is highly appreciated.

Gérard

Received on Friday, 25 October 2013 15:17:54 UTC