00156: unordered list

Summary: unordered list
Created: 2004-11-12 13:11
Status: Closed - not a bug
Category: Bug
From: Stefan
Assigned:
Priority: 3
Version: 2.0.devel20
OS: Linux/Apache

Description: Something like

  • item one
    • subitem one
  • item two

produces the following code with "hanging" </li>s

<ul>

	<li> <a class='urllink' href='...'>News</a>
	<ul>
		<li> <a class='urllink' href='...'>Heute</a></li>
		<li> <a class='urllink' href='...'>Archiv</a></li>
	</ul></li>

</ul>


Ummm, I don't see the "hanging" </li>s you're describing. For example, the "item one/subitem one/item two markup" given above in the example is correctly producing:

 
<ul><li> item one
<ul><li> subitem one
</li></ul></li><li> item two
</li></ul>
  

Each list item is correctly terminated. What's more, this page correctly validates -- see http://validator.w3.org/check?uri=referer.

Can you give a better example?

--Pm


I thought it should look like

 
<ul>
  <li> item one</li>
    <ul>
      <li> subitem one</li>
    </ul>
  <li> item two</li>
</ul>
  

But probably I'm wrong ... -- Stefan


Stefan - your example is not correct. A list must be within a list.

e.g.

 <ul>
  <li> item one
    <ul>
      <li> subitem one</li>
    </ul>
  </li>
  <li> item two</li>
</ul>

not

 <ul>
  <li> item one</li>
    <ul>
      <li> subitem one</li>
    </ul>
  <li> item two</li>
</ul>
  

Stated another way, the only thing that a <ul> element can contain is <li> elements. Anything nested inside an unordered list must be inside of the <li>'s. --Pm