W3C home > Mailing lists > Public > www-html@w3.org > April 2000

Re: Ignoring empty paragraphs

From: Matthew Brealey <webmaster@richinstyle.com>
Date: Mon, 10 Apr 2000 10:21:22 -0400 (EDT)
Message-ID: <38F254D0.6F3A@richinstyle.com>
To: www-html@w3.org
Ian Graham writes:
> I think Jason's idea of an :empty pseudo-class is the most appropriate way
> of handling the rendering issue. 

Haven't you read my reply to that? It isn't necessary - margins

> Indeed, you then have much finer control
> over the formatting process, and in a way that can apply to other elements
> also. For example, you could have a rule such as:
> p:empty p:empty  { display: none}
> div:empty div:empty {display: none}
> to remove consecutive empty paragraphs and consecutive empty divs from the
> rendering process.

I think you mean P:empty + P:empty  and div:empty + Div:empty. However,
as explained this isn't doing anything - in fact in current
implementations you need to disable 'ignoring' (i.e., margin collapsing)
of Ps, by making the element non-empty so that margins cannot collapse;
ways of doing this are: &nbsp; to create a line box so that the element
is not empty; <br> for the same reason; padding, border, or height.
Received on Monday, 10 April 2000 12:51:41 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:05:53 UTC