Nested Lists

Fredrik Wangel (
Wed, 11 Mar 1998 11:39:24 -0500 (EST)

Date: Wed, 11 Mar 1998 11:39:24 -0500 (EST)
Message-ID: <>
From: Fredrik Wangel <>
Subject: Nested Lists

I came accross a very strange error when I ran a validation on
a page of mine using the W3C Validation Service.

I used a simple nested unordered list, which according to
the specification [2] is quite alright:
   "Lists may also be nested:"

My list was in principle constructed as follows:


The Validation Report said:
   Error at line 75:
         document type does not allow element "UL" here;
         assuming missing "LI" start-tag

I double-checked the code but it had both the start and the
optional end-tag (<li> and </li>), so I read the list section
in the specification [2] again and I could not find anything
that would indicate that my code was bad.

The only thing was that the end-tag of li is optional, so
I simply removed it and - voila - it passed the tests.

The source code, both the "bad" [3] and the "corrected" [4] one,
are available for viewing.


... and another thing:

Why is there no List Header <lh></lh> element?
It would be nice, especially with nested lists, to
have an element that can act like a header of the
list. In a visual user agent, this could simply be
rendered as bolder text. In a speaking browser,
it could have other important functions, e.g.
letting the user listen to the the list headings
first, chosing which "branch" to hear more about.

   1. Software
      * Games
      * Applications
      * Development Tools
   2. Recreation
      * Music
      * Books

(spoken) There are two topics. For Software, press 1,
for Recreation, press 2.

This might be enhanced using CSS2 and content insertion.



Fredrik Wangel, Svedjevagen 157, SE-394 71 Kalmar, Sweden
Tel. : +46 (0)480 479191, Fax. : +46 (0)480 479165