Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML HTML Lists HTML Lists

nested ordered list not working

I am supposed to add a nested ordered list into my "shapes" unordered list. My code is not reading.

index.html
<!DOCTYPE html>
<html>
  <head>
    <title>HTML Lists Challenge</title>
  </head>
  <body>

    <h1>HTML Lists Challenge</h1>

    <!-- Write your code below -->
<ol>
  <li>Stop</li>
  <li>Drop</li>
  <li>Roll</li>
</ol>
<ul>
  <li>Shapes</li>
    <ol>
      <li>square</li>
      <li>circle</li>
  </ol>
  <li>Colors</li>
</ul>

  </body>
</html>

3 Answers

Aaron Chiandet
Aaron Chiandet
9,826 Points

I can't find the task so this is a guess...

You can't nest a ul in an ol and vice versa. The only valid child of a list is a li, so you would nest it in a child li. Like so:

<ol>
  <li>Stop</li>
  <li>Drop</li>
  <li>Roll</li>
</ol>
<ul>
  <li>Shapes
    <ol>
      <li>square</li>
      <li>circle</li>
    </ol>  
   </li>
  <li>Colors</li>
</ul>

Thank You Aaron. It worked. I didn't remove the closing tag from behind shapes. its was still there. I needed to move it to the bottom of the nested list for it to be correct. =) thanks for the help.