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

General Discussion

Nested lists - Question 5

Hi, in question 5 we're asked to create a nested ordered list inside the shapes list item. Can anyone tell me what I'm doing wrong? Thanks

<ul> <li>Shapes</li> <ol> <li>abc</li> <li>def</li> </ol> <li>Colors</li> </ul>

You're going to have to put the code in here; otherwise, I'm not really sure what may be causing the code to fail the challenge. If you need help with knowing how to do it, you can click the "Markdown Cheatsheet" link below each forum text area.

4 Answers

Sorry Adam, I haven't added code to forum before. Hopefully this will do it

<ul>
      <li>Shapes</li>
        <ol>
         <li>abc</li>
         <li>def</li>
        </ol>
      <li>Colors</li>
    </ul>
    ```

Sorry, i really have to look how to post code.

But Adams answer is right.

I made this mistake many times before trying to do something like this. What happens at the end of the "Shapes" list item when you put the </li> closing mark is completely close that list item. So when you put your <ol> underneath the "Shapes" list item, it isn't nested, it's simply placed beneath the "Shapes" list item. Therefore, what you need to do is do this:

<ul>
   <li>Shapes
      <ol>
         <li>abc</li>
         <li>def</li>
      </ol>
   </li>
   <li>Colors</li>
</ul>

This way, your "Shapes" list item (<li>) begins before the word "Shapes" and ends(</li>) just after the end of the nested ordered list.

Brilliant! Never spotted that before. Thanks a million

No problem!

Looks like you need to move that first closing li after the ol

<ul> <li>Shapes <ol> <li>abc</li> <li>def</li> </ol> </li> <li>Colors</li> </ul>