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 */

Received on Wednesday, 11 March 1998 12:14:37 UTC