RE: collapsing margins illogical


I agree with you.  I have been perplexed by some of the decisions regarding
CSS that have been made.  For example, when you specify the width of a box,
you are actually specifying the width of the content inside the box, not how
wide the entire box should be.  If we used that method in the real world, we
would have 8 1/2 x 11 sheets of paper that are actually 9 1/2 inches wide,
thanks to the margin on the left.


-----Original Message-----
From: Sean Proctor []
Sent: Monday, January 07, 2002 9:40 PM
Subject: collapsing margins illogical

what was the design decision behind the way margins are collapsed between
nested blocks?  to me it seems to make far more sense to maintain the
margins as much as possible without taking extra space.

blockA { margin: A; }
blockB { margin: B; }
blockC { margin: C; }

it would make sense to me for the margin between blockC and blockA to be
max(C, A).  the margin between blockA and blockB then would be 0 if B <
max(A, C) otherwise B - max(A, C).  or simply max(0, B - max(A, C)).  in
otherwords, the margin of a block is not affected by its content.

an example that clearly illustrates this is  One would expect the space at the top
of the list to be gray, but it's blue.  According to the spec this makes
sense, but intuitively it doesn't.


PS Could you CC any responses to me?

Received on Tuesday, 8 January 2002 14:08:42 UTC