Re: Missing closing li tag, "document was successfully checked as HTML 4.01 Transitional!"

Axel Christiansen <axel.christiansen@piranha.de> writes:
> This doc snippet has validated all right, even with a missing "closing
> li tag".
>
> Should it be that way?

In HTML 4.01, yes - the closing tag is optional since the end of the
element can be deduced by the appearance of another <LI> or of </UL>.

If you look at the HTML DTD, you'll find this:

<!ELEMENT UL - - (LI)+                 -- unordered list -->
<!ELEMENT LI - O (%flow;)*             -- list item -->

the dash-dash after UL means that neither the start tag nor the end tag
are optional, while the dash-O after LI means that the end tag is
optional.

(remember, this is SGML, not XML - in XML, tags are never optional)

DES
-- 
Dag-Erling Smørgrav - des@des.no

Received on Tuesday, 26 January 2010 13:40:24 UTC