Re: nested lists depreciated?

On Fri, 20 Dec 2002 www-style@waite.sunesistech.com wrote:

> 
> Hi folks,
> 
> I've been having some problems getting pages to validate
> (specifically as XHTML Transitional) when they have a nested
> list in them. ex:
> 
> <!-- begin snippet -->
> 
> <ul>
> 
> <li>one</li>
> <li>two</li>
> 
> 	<ol>
> 
> 	<li>one</li>
> 	<li>two</li>
> 
> 	</ol>
> 
> </ul>

The above is invalid because the ol isn't allowed as a child
of a ul element. You need to place it within an li, e.g.

<ul>
<li>one</li>
<li>two

<ol>
<li>two.one</li>
<li>two.two</li>
</ol>
</li>

<li>three</li>
</ul>

I would also recommend avoiding "mixed content" by enclosing
the list item contents in block-level elements, e.g.

<ul>
<li>
<p>one</p>
</li>

<li>
<p>two</p>

<ol>
<li>two.one</li>
<li>two.two</li>
</ol>
</li>

<li>
<p>three></p>
</li>
</ul>


-- 
 Dave Raggett <dsr@w3.org> or <dave.raggett@openwave.com>
 W3C lead for voice/multimodal. http://www.w3.org/People/Raggett 
 tel/fax: +44 1225 866240 (or 867351) +44 771 213 7629 (GSM)

Received on Saturday, 21 December 2002 09:46:03 UTC