Re: Nested Lists
Adam M. Donahue (adam@cyber-guru.com)
Wed, 11 Mar 1998 12:14:10 +0000
Message-Id: <9803111714.AA27093@acf2.nyu.edu>
From: "Adam M. Donahue" <adam@cyber-guru.com>
To: www-html@w3.org, Fredrik Wangel <fw11ab@student.hik.se>
Date: Wed, 11 Mar 1998 12:14:10 +0000
In-Reply-To: <3506BEB6.2ABEFFE6@student.hik.se>
Subject: Re: Nested Lists
Hi,
Actually, the error was correct according to the DTD.
> <ul>
> <li>Heading</li>
> <ul>
> <li>Subitem</li>
> <li>Subitem</li>
> </ul>
> </ul>
> The Validation Report said:
> Error at line 75:
> <ul>
> document type does not allow element "UL" here;
> assuming missing "LI" start-tag
If you look at the standard, it says that element UL can only contain
LI elements. [1] Because the close tag of LI is optional, if you
have code such as:
<UL>
<LI>Blah
<UL><LI>Another blah</UL>
</UL>
then it's legal. This assumes that your nested UL is actually an
element of the "Blah" LI element. If you close that element, then
the nested UL becomes part of the parent UL, which is not allowed.
So, it's not broken, but perhaps it's a little ambiguous.
Adam
1. http://www.w3.org/TR/REC-html40/struct/lists.html#edef-UL
/* mailto:adam@cyber-guru.com */