Re: <li> </li> or <li />?

by "Michael Gerholdt" <gerholdt(at)>

 Date:  Tue, 23 May 2000 23:02:17 -0400
 To:  <hwg-techniques(at)>
 References:  ionet anakin
  todo: View Thread, Original
Point being, Wistful Miss, that the <li> element is not empty but has
content; therefore has an opening tag and a closing tag.

The discussion generally is in regards to elements that follow normal
rules - that is, elements that have content and therefore opening and
closing tags - and elements that are empty. </br> is actually an illegal
tag. </li> is in html optional and in xml required. Good practice suggests
its use.

Is it perhaps a bit regrettable that xml requires closing tags for empty
elements? I've not looked deeply into the logic that leads to this
requirement; seems that specs could easily designate a tag 'normal' or
'empty' and that if empty, closure is moot. <br /> just seems proper for the
sake of propriety rather than for the sake of functionality/necessity.

> <li> already has a closing tag: </li>  In HTML, you can include it or not,
> because the browser can infer its presence by the next <li> tag, or the
> </ul> or </ol> tag.  If you want to be XML compatible, use the closing
> tag.

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA