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

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

From: Jonas Salling <salling@cooper.xanthus.se>
Date: Mon, 2 Jun 1997 16:27:18 -0100
Message-Id: <97Jun2.184529gmt-0100.28730-1@mimer.upnet.se>
To: <fahrner@pobox.com>, <www-style@w3.org>
Thanks Todd, but I'm afraid the problem is somewhat
more subtle than this.

The question is whether and/or how CSS can be
used to describe spacing between paragraphs in
a convenient manner.

Let us assume a browser's default style sheet uses
margin-top and/or margin-bottom to render documents
in a way that there is spacing between paragraphs.

Now, what happens at the top of the canvas? Or at
the top/bottom of a table cell?

As far as I understand, top and bottom margins
for elements at the top or bottom of a containing
block should not be collapsed. This, in turn, will
cause table cells (as an example) to be rendered in
a funny looking way with lots of space in them.


This is what I would like to have:
____________________
|Here in one paragraph.
|
|Here is another.


But using margin-top, I should get:

____________________
|
|Here is one paragraph.
|
|Here is another.


 
What does IE4 do? Are top-margins collapsed against
a containing box? This would be in conflict with the CSS1
specification (unless I didn't understand it correctly, which
is what I hope).


BTW: We are designing our own authoring software,
so the question isn't really about how to hack IE or
NS to achieve some effect. But thanks anyway, for
your little IE hack!


Regards,

Jonas Salling



----------
> From: Todd Fahrner <fahrner@pobox.com>
> To: Jonas Salling <salling@cooper.xanthus.se>; www-style@w3.org
> Subject: Re: Distance between <P> (and other) tags?
> Date: Monday, June 02, 1997 6:45 PM
> 
> 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
> mailto:fahrner@pobox.com
> http://www.verso.com/
> 
> 
Received on Monday, 2 June 1997 13:31:20 GMT

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