[oclug] html tools

Jon Earle je_linux at kronos.honk.org
Mon Aug 26 09:11:50 EDT 2002


On Sun, 25 Aug 2002, Michael P. Soulier wrote:

> On 25/08/02 Jon Earle did speaketh:
>
> > As long as they remove some of the less useful closing tags - </p> is not
> > of much use, IMHO.  It's cleaner, I think, to code:
> >
> > <p>
> > This is a paragraph.
> > <p>
> > This is another paragraph.
> > <p>
> > And yet one more.
> > <br>
> >
> > than to litter your page with </p>'s that just seem redundant.  To be, <p>
> > is like <br> with a kick.
>
>     Nope. No exceptions. You must remember that the point of a tag is to
> delimit a section, and describe the content. The assumption that a new
> paragraph tag closes the last one is a hard-coded exception that helps to make
> browsers buggy. Explicit closing tags remove all ambiguity for parsing
> software.

You don't close <br>, <hr>, so why close <p>?  It just starts a new
paragraph with a blank line separating it from the previous item... no
difference really than <br><br> at the end of a line.

Other tags that I don't think need closing include <li> - the next <li> or
the closing </ul> are sufficient to indicate the end of an item's text.

Sometimes tags are just not special enough to warrant closing.
<font></font>, yes.  <p></p>, no.

>     Not to mention the fact that in your example above, the content of the
> first paragraph would be "\nThis is a paragraph\n", which is probably not what
> you want in the paragraph. It should be <p>This is a paragraph</p>.
>     In fact, in DocBook, you'll have to type more. Paragraph tags are <para>.

With the way html is rendered, it makes no difference to do

<p>This is a paragraph.</p>

vs

<p>
This is a paragraph.
</p>

All the extra whitespace is eliminated.  It really used to irritate me
that the extra space was removed, forcing me to insert &nbsp; to space
things nicely, but, c'est la vie.  Someone obviously decided it was a good
idea at the time.

I use the latter so I can edit the text between the tags more freely - it
stands out better not having these odd things at either end.  :)  Just a
matter of preference I guess.

Cheers!
Jon




More information about the OCLUG mailing list