[Prev][Next][Index][Thread]

Re: To <P> or not to <P>



Lee Daniel Crocker wrote:

> 2. </P> is never necessary for any reason.  The end of a logical
> paragraph is implied by the beginning of the next element, either
> a paragraph, a heading, a division, or other "block" element.

Neither MSIE 3.0 nor NSN 2.0 treat <DIV> this way. A heading or
another paragraph will implicitly close the preceding paragraph, but
a division does not. It simply forces a new line.

<DIV> can also be inserted into a heading without implicitly closing
it. In other words, <DIV ALIGN=center> works exactly like the
<CENTER> tag. <DIV> is not implicitly closed by anything, including
another <DIV>. Try <DIV ALIGN=center>centered text<DIV
ALIGN=right>flush right text</DIV>more centered text</DIV>

Headings close paragraphs, but they're not implicitly closed by them,
unless <P> has been declared in a style sheet (MSIE 3 only). Even
then it's not really a close, just a supersession. The text inherits
any attributes of the heading if they have not been declared for <P>.
After a closing </P>, the heading style resumes. Headings, like
divisions, can be nested in headings.

The upshot: in NSN and MSIE, you can only rely on <P> or <Hn> to
implicitly close a paragraph. Close the last paragraph before any
other block tag with </P>.

David Perrell


Follow-Ups: