Re: CSS22 don't understand box model

On Thu, Sep 1, 2016 at 1:36 PM, pierre lafitte <lingtalfi@gmail.com> wrote:
> Hi, I don’t understand this section:
>
>
> https://drafts.csswg.org/css2/box.html > 8.3.1 collapsing margins:
>
> Two margins are adjoining if and only if:
> - no line boxes, no clearance, no padding and no border separate them
> - both belong to vertically-adjacent box edges, i.e. form one of the
> following pairs:
> —— top margin of a box and top margin of its first in-flow child
>
>
> Isn’t that contradictory?
> I mean, if you have a top margin of a box and top margin of its first
> in-flow child,
> then necessarily when you go from the top margin of the box to the top
> margin of the first in-flow child you cross the
> (parent) box’s border box, as in:
>
> parent box margin
> parent box border (this is always crossed, right?)
> parent box padding
> parent box content
> child box top margin
>
>
> So isn’t that contradictory with this statement?
> - no line boxes, no clearance, no padding and no border separate them

As Oriol implied, while a border box and padding box always exist,
there's only border or padding if, well, there's actually some border
or padding.  Zero-width padding or border, or a suppressed border,
mean there is "no padding" and "no border".

~TJ

Received on Thursday, 8 September 2016 18:05:03 UTC