W3C home > Mailing lists > Public > html-tidy@w3.org > July to September 1999

Re: Bug: Tidy (26 July 1999) warns about nested OL and UL

From: <kent@darwin.eeb.uconn.edu>
Date: 16 Aug 1999 17:23:57 -0400
To: "Morten Elling" <elling@post1.tele.dk>
Cc: <html-tidy@w3.org>
Message-ID: <wk7lmv2zde.fsf@darwin.eeb.uconn.edu>
From the HTML4 dtd

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

Thus, the only element that can occur inside an <ol></ol> or <ul></ul>
pair is an <li>. Fortunately, an <ol></ol> or <ul></ul> can appear
inside an <li>. So all you need to do to nest lists you need to
rearrange your end tags a bit:

<ol>
  <li>The basics <!-- Delete it from here -->
    <ol>
      <li>Intro</li>
      <li>&quot;Hello, world&quot;</li>
    </ol>
  </li> <!-- and move it here -->
  <li>Step two <!-- Delete it from here -->
    <ul>
      <li>What's wrong with &quot;Hello&quot;?</li>
      <li>Register use</li>
    </ul>
  </li> <!-- and move it here -->
  <li>Step three</li>
</ol>

Kent

-- 
Kent E. Holsinger                Kent@Darwin.EEB.UConn.Edu
                                 http://darwin.eeb.uconn.edu
-- Department of Ecology & Evolutionary Biology          
-- University of Connecticut, U-43                                       
-- Storrs, CT   06269-3043                                               
Received on Monday, 16 August 1999 17:20:31 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:42 GMT