Does everything inside a <ul> have to be wrapped in an <li>?

Posted by Drew on Stack Overflow See other posts from Stack Overflow or by Drew
Published on 2009-07-30T22:14:38Z Indexed on 2011/01/03 21:54 UTC
Read the original article Hit count: 197

Filed under:

Hello,

I need some guidance about nested lists in HTML.

I have a layout that I would like to be built like below. Is it a terrible thing to nest an element not wrapped by an <li>? I'm fairly sure that it is against standards, but don't know what ill effect it has.

<ul>
  <li>
    <h1>header 1</h1>
    <li>
       <ul>
         <li>nested</li>
         <li>list</li>
       </ul>
    </li>
  </li>
  <li>
    <h1>header 2</h1>
    <li>
       <ul>
         <li>nested</li>
         <li>list</li>
       </ul>
    </li>
  </li>
</ul>

© Stack Overflow or respective owner

Related posts about html