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 inside unordered list

Hi, I have honestly no clue why this is incorrect. The task is to add the ordered list inside the list item "Shapes", which is an unordered list.

<ul>
<li>Shapes</li>
    <ol>
          <li>Line</li>
    </ol>
</ul>

The preview shows correctly as: Shape

  1. Line Thanks!!

3 Answers

Stone Preston
Stone Preston
42,016 Points

nested lists go inside the list item you want to nest it in like this:

<ul>
<li>Shapes
  <ol>
          <li>Line</li>
    </ol>

</li>
<li>Colors</li>
</ul>

notice how the nested ordered list is inside the shapes list item tags. see the W3 wiki for more examples. While your current way displays correctly, the correct way according to the W3 is to nest it inside the list item itself

Thanks Stone. I wasn't aware the fact that I need to put </li> at the end of the nested list.