Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML HTML Lists HTML Lists

Stage 3 Lists - Adding a nested ordered list inside an unordered one

I have had a lot of issues trying to get through the code challenge for Stage 3 Lists. It says to add items and what it seems to mean is replace (that is the only way that I have gotten this far in the challange.

I am on the Adding a nested ordered list inside an unordered one. Here is the code that it keeps telling me is wrong, please let me know what I'm doing incorrectly.

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

2 Answers

Celestial Goldsmith It is a bit hard. But there is no need to worry about. Let me explain in a way that you can understand easily.

Challenge one is to create ordered list. In HTML, to create an ordered list we should use opening and closing <ol> element. Something like this.

<ol>


</ol>

In challenge 2, you have been asked to add list items. You can add items to ordered list using opening and closing <li>. Something like this.

 <ol>
      <li>Stop</li>
      <li>Drop</li>
      <li>Roll</li>
   </ol>

The reason why I add <li> inside <ol> is I wanted items to be numbered.

Challenge 3 is about creating unordered list. To create an unordered list in HTML document, you should use opening and closing <ul> element. Something like this.

<ul>

</ul>

There is a small thing wrong in your code is

ordered list is not a child to list item. What I mean is, check the below code.

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

If ordered list is not child to list item then it become sibling to list items and direct child to unordered list. So you will have to nested inside list item.

I hope it helps.

Thank you! I think I understand now.