RE: Ignoring empty paragraphs

I wrote:
>> <div>foo</div><p></p><div>bar</div>
>>
>> The <p> is not "ignored" here;
>> it introduces a gap of about 1em, depending on your browser's
>> setting for margins on <p>.

Jan Roland Eriksson replied:
> It does _not_ in Mozilla M14 "strict" mode.
> (yes, I did try exactly your line up here before posting :)

If it doesn't, then perhaps it is pruning the empty <p> elements
altogether, before the rendering engine sees them.  In any case,
CSS2 requires the gap if the <p> elements remain in the tree:

CSS2 Recommendation, Section 8.3.1, "Collapsing Margins":
http://www.w3.org/TR/REC-CSS2/box.html#collapsing-margins
] Two or more adjoining vertical margins of block boxes in the
] normal flow collapse. The resulting margin width is the maximum
] of the adjoining margin widths.

-- 
Jason Orendorff

Received on Monday, 10 April 2000 18:23:53 UTC