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

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

From: Todd Fahrner <fahrner@pobox.com>
Date: Mon, 2 Jun 1997 09:45:28 -0700
Message-Id: <v03102801afb8a6c3c258@[]>
To: "Jonas Salling" <salling@cooper.xanthus.se>, <www-style@w3.org>
At 3:03 PM -0100 6/2/1997, 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?

I take it you are using IE3? There is a well-known bug in this
implementation, affecting all (?) block-level elements like <Hn>, <P>,
etc., that will prevent you from achieving the desired effect. The bug is
fixed in IE4b1, and NS4b5 has nearly got it right.

The code you want is

	P { margin-top: 0;
		margin-bottom: 0

The actual space separating paragraphs should equal the line-height
specified for paragraphs. NS4b5 uses some other figure, though.

If you really need to hack something together for IE3, try replacing all of
your <P></P>'s with <DIV CLASS=P></P>'s. Then write

	.P { margin-top: 0;
		 margin-bottom: 0

Todd Fahrner
Received on Monday, 2 June 1997 12:44:44 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:26:43 UTC