Re: Ignoring empty paragraphs

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
collapse.

> 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:   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