Paragraphs Elements as Containers

Robert Seymour robert_seymour at il.us.swissbank.com
Wed May 10 16:39:57 PDT 1995


> BTW, using <P> at the end of a paragraph is commoon but incorrect,
> while this
> <P> sentence 1
> <P> sentence 2
> is correct use. However, nobody does this, so browsers have to guess
> the missing starting tag and imply an end tag whenever the next <P>
> starts a new paragraph.

Actually, that's not quite right (I hope this doesn't come across as picking  
nits, I think its important becuase it can cause text to format improperly if  
the spec is not followed).

The use of standalone paragraph descriptors should be only to separate one  
paragraph from another in sucession.  They should not be used (in a  
generalized sense) to initiate or to end a paragraph unless they are used as  
a container.  Doing so can lead to extraneous whitespace if certain other  
tags and a paragraph tag are chained together (for instance a list end and  
paragraph tag).  For example:

  <body>
  This is paragraph 1.<p>
  This is paragraph 2.<p>
  This is paragraph 3.
  </body>

is correct while:

  <body>
  <p>This is paragraph 1.
  <p>This is paragraph 2.
  <p>This is paragraph 3.
  </body>

is non-spec and will result in excess whitespace before the first paragraph  
under some clients (though not OmniWeb, thankfully, which knows that once a  
break exists not to place a new one in just becuase a paragraph tag is  
encountered).

Similar errors can result if used after a paragraph when the next element is  
not also a paragraph.  That they are placed at the end of the paragraph as  
opposed to the beginning of the next doesn't matter, though convention has  
been to use them at termination.  When using paragraph tags standalone, just  
think insert a paragraph tag only if I specifically want to break one  
paragraph from another.

The emphasis with the IETF WG is to containerize all paragraphs so that  
problems of this sort are avoided and also to allow for extra parameters such  
as those present in Netscape's "experimental" HTML (e.g.: <p  
align="justify>My justified paragraph.</p>).  I'm not sure if this is in the  
current DD yet (I haven't read the latest version yet), but I'd recommend it  
as standard practice.  I have written all my documents this way for the last  
year or so, though I did not before.

Regards, Robert

--
Robert Seymour			 seymour at il.us.swissbank.com
Swiss Bank Corporation		 (NeXTMail, MIME, PGP accepted)

Internal Web: <URL:http://sbcweb/~seymour/>
Internet Web: <URL:http://www.reed.edu/~rseymour/>


More information about the OmniWeb-l mailing list