Re: Collapsing vertical margin through parent. why?

On 15 Oct 2003 at 11:54, Boris Zbarsky wrote:
> Michael Favia wrote:
> > I was wondering if there is any reason that the vertical margins of a
> > block level element should collapse through the content block of its
> > parent. 

> The idea is that margins serve to separate content and that the biggest 
> separation applicable should take effect rather than adding up all the 
> separations.  This leads to mostly intuitive results when writing 
> documents and marking them up with CSS -- people don't want the spacing 
> between their sections depending on the contents of the section, 
> typically, unless the contents really need more spacing around them than 
> sections already have by default.

I agree that this theory works with trivial markup and for simple 
cases. I am not quite as sure whether the added complexity is worth 
the benefit, and i know i have been bitten by this issue and it is an 
easy misstake to make in more complex designs. I currently think that 
deprecating this feature would be a good thing to do.

A better route would probably be to require the author do explicitly 
remove such excess margins when it does cause problems, or do things 
like with nested lists in the default style sheet if there are know 
cases where the nested margin are known to cause a problem.  

I also think the feature may be to simplistic as it works. If your 
example had a background color on section, the margin of the children 
para should probably not have been collapsed.


Received on Thursday, 16 October 2003 13:24:38 UTC