W3C home > Mailing lists > Public > www-validator@w3.org > January 2010

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

From: Dag-Erling Smørgrav <des@des.no>
Date: Tue, 26 Jan 2010 14:39:50 +0100
To: Axel Christiansen <axel.christiansen@piranha.de>
Cc: www-validator@w3.org
Message-ID: <86pr4xj87t.fsf@ds4.des.no>
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

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

Dag-Erling Smørgrav - des@des.no
Received on Tuesday, 26 January 2010 13:40:24 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 1 March 2016 14:18:00 UTC