W3C home > Mailing lists > Public > www-style@w3.org > June 1997

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

From: David Perrell <davidp@earthlink.net>
Date: Mon, 2 Jun 1997 19:06:43 -0700
Message-Id: <199706030207.TAA29755@denmark.it.earthlink.net>
To: "Jonas Salling" <salling@cooper.xanthus.se>, <www-style@w3.org>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:53:50 GMT