Re: Validations..Help!!

by "Donna M Smillie" <dms(at)zetnet.co.uk>

 Date:  Wed, 23 Feb 2000 17:55:19 -0000
 To:  <hwg-basics(at)hwg.org>
 References:  erols
  todo: View Thread, Original
----- Original Message -----
From: Mike Eovino <meovino(at)erols.com>

> ><ul>
> ><li>Item 1</li>
> ><li>   <------------DON'T NEED THIS ONE
> >    <ul>
> >    <li>Item 1 sub</li>
> >    </ul>
> ></li>  <------------DON'T NEED THIS ONE
> ><li>Item 2</li>
> ></ul>
>
>
> I didn't validate your code with W3C, and HomeSite's little validator
said
> it was ok, but it would seem to me that a nested list is not, in fact,
a
> list item.  As such, it shouldn't be surrounded with <li></li> tags.

Except that the spec for HTML 4 says that the only things that can go
inside <ul> or <ol> elements are <li> elements:

<!ELEMENT UL - - (LI)+                 -- unordered list -->
<!ELEMENT OL - - (LI)+                 -- ordered list -->

While <li> elements on the other hand, can contain many other elements:

<!ELEMENT LI - O (%flow;)*             -- list item -->
<!ENTITY % flow "%block; | %inline;">

So it's actually invalid to put a sublist inside a main list, except by
making it part of one of the main list items.

Regards,
Donna
--
dms(at)zetnet.co.uk
Different Worlds:  http://www.users.zetnet.co.uk/dms/
Pictures of the Past, The Leslie Smith Family,
An Introduction to HTML, Copyright Considerations
Online Bookshop

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA