
Signature
Owen Rees
[one of] my preferred email address[es] and more stuff can be
found at <http://www.users.waitrose.com/~owenrees/index.html>
> 8.3.1 Collapsing margins
>
> In this specification, the expression collapsing margins means that
> adjoining margins (no non-empty content, padding or border areas or
> clearance separate them) of two or more boxes (which may be next to one
> another or nested) combine to form a single margin.
Thanks for the link and I don't wish to seem ungrateful. But I find this
hard to understand. If a and b are separated by c, then c comes between a
and b. As the margins are outside the padding and border, as I see it,
padding and border do not come between the margins of adjacent boxes, so do
not separate them. Or do "between" and the verb "to separate" mean
something different from what I think?

Signature
Tony W
My e-mail address has no hyphen
- but please don't use it, reply to the group.
Owen Rees - 28 Aug 2008 20:57 GMT
>Thanks for the link and I don't wish to seem ungrateful. But I find this
>hard to understand. If a and b are separated by c, then c comes between a
>and b. As the margins are outside the padding and border, as I see it,
>padding and border do not come between the margins of adjacent boxes, so do
>not separate them. Or do "between" and the verb "to separate" mean
>something different from what I think?
You have a p followed by a div containing a p, i.e.
<p></p>
<div>
<p></p>
</div>
Considering only top and bottom you have:
p top margin
p top border
p top padding
p content
p bottom padding
p bottom border
p bottom margin - m1
div top margin - m2
div top border - b3
div top padding - p4
p top margin - m5
p top border
p top padding
p content
p bottom padding
p bottom border
p bottom margin
div bottom padding
div bottom border
div bottom margin
If border b3 and padding p4 are empty them margins m1, m2 and m5
collapse into a single margin of size max(m1,m2,m5). If either of b3 and
p4 are non-empty then m1 and m2 will still collapse together to a margin
of size max(m1,m2) but m5 will not collapse with them.
The collapsing of m2 and m5 is explicitly covered [refs added]:
"The top margin [m2] of an in-flow block-level element is adjoining to
its first in-flow block-level child's top margin [m5] if the element has
no top border [b3], no top padding [p4], and the child has no
clearance."

Signature
Owen Rees
[one of] my preferred email address[es] and more stuff can be
found at <http://www.users.waitrose.com/~owenrees/index.html>