Re: Distance between <P> (and other) tags?

Jonas Salling wrote:
> Is it possible to achieve the effect of <P> tags being
> separated using CSS without getting unwanted space
> at the top and/or bottom of the containing block?

From section 4.1.1 of the CSS1 spec: "... Two or more adjoining
vertical margins (i.e., with no border, padding or content between
them) are collapsed to use the maximum of the margin values..."

True whether elements are siblings or nested (note "two or more").
 
> I was thinking one could achieve the familiar HTML
> rendering of paragraphs by adding the following to
> the default style sheet used by the browser:
> 
> P { margin-top: 5px; }
>

What is 'familiar HTML rendering'? And what is the 'default style sheet
used by the browser'? Default margins in NSN and MSIE are vastly
different, and the user has the option of overriding defaults. You have
no way of knowing what the margins of the browser's/user's stylesheet
might be.

Author's stylesheet declarations are supposed to override the browser's
defaults, not add to them. The bug in MSIE 3.x is that the author's
style declarations do not override MSIE's built-in vertical margins on
'standard' HTML elements. This will change with MSIE 4.

David Perrell

Received on Monday, 2 June 1997 22:07:45 UTC