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

Jamil Jones
Jamil Jones
10,852 Points

Adding an Nested ordered list to an unordered list

This exercise keeps saying this is wrong. What am I missing

<ul>
    <li>Fruit</li>
    <ol>
        <li>Orange</li>
        <li>Apples</li>
    </ol>
    <li>Vegetables</li>
</ul>

Please Help, what am I doing wrong

8 Answers

James Barnett
James Barnett
39,199 Points

The only valid tags to put inside an ul is an li.

So if you want to nest a ol inside of an ul then you need to first nest it inside of an li, like so ...

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

I can't get this to work, and I've spent a long time on this task. It should have been explicitly mentioned in the Petit's video that the only valid tag that can go in a ul tag is an li tag (even though in your example an ol tag IS inside a ul tag but only after another li tag. I honestly don't know how Treehouse expects us to perform a task that wasn't covered in one of the videos. This should be very simple, and I should have watched at least eight other videos by now. At this point I'm tired of guessing and would appreciate some very, very explicit help. I realize that you are opposed to giving the solution (for some didactic reason that I personally believe is quite antiquated). PLEASE HELP. Your code above did not. I tried it, and it was of absolutely no help even with plenty of further guesses and modification. Eager to get back to learning...

I can't get this to work, and I've spent a long time on this task. It should have been explicitly mentioned in the Petit's video that the only valid tag that can go in a ul tag is an li tag (even though in your example an ol tag IS inside a ul tag but only after another li tag. I honestly don't know how Treehouse expects us to perform a task that wasn't covered in one of the videos. This should be very simple, and I should have watched at least eight other videos by now. At this point I'm tired of guessing and would appreciate some very, very explicit help. I realize that you are opposed to giving the solution (for some didactic reason that I personally believe is quite antiquated). PLEASE HELP. Your code above did not. I tried it, and it was of absolutely no help even with plenty of further guesses and modification. Eager to get back to learning...

James Barnett
James Barnett
39,199 Points

> I honestly don't know how Treehouse expects us to perform a task that wasn't covered in one of the videos.

It's been a while since I watched that video so I was curious to see what Nick Pettit actually demo'ed in the video, at about time index 3:48 Nick shows you an example of a correctly nested list.

Nick Pettit
Nick Pettit
Treehouse Teacher

Hi Daniel Luke,

Sorry that you're having trouble. Coding can be frustrating at first, but we're here to help. Can you please post your code in the forum? This will help people identify what type of issue you're experiencing. Thanks!

Found the answer here as well http://teamtreehouse.com/forum/nested-ordered-list-html-list-challenge

Trick is in the reading the instructions carefully, nest INSIDE the Shapes list item.

<li>Shapes <ol> <li></li> </ol> </li>

Sam Bass
Sam Bass
9,038 Points

Thank You! :)

James Barnett
James Barnett
39,199 Points

The key to nested lists to to remember the only valid child of an ul or an ol is an li.

@Jamil - Let us know, if you need anymore help.

Jamil Jones
Jamil Jones
10,852 Points

Still saying its wrong

Instructions: Add a nested ordered list to the "Shapes" list item.

Code I put in:

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

<h1>HTML Lists Challenge</h1>

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

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

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

</body> </html>

Results: HTML Lists Challenge

Stop Drop Roll

Shapes 1. 2. 3. Colors

Help!!! What am I doing wrong

Cristiane Marques
Cristiane Marques
1,780 Points

Jamil Jones,

Your example will work if you add the missing <li></li>tags. The first <li> should come first than the <ol> and the closing </li> after the </ol>. Look at James Barnett's example. It's perfect! It was indeed covered by Nick Pettit on the video "Ordered and Unordered Lists".

Good Luck!

Here's the answer:

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

Gagandeep Virk
Gagandeep Virk
19,741 Points

I have found it the solution Here it is......... <ul> <li>Shapes <ol><li>This is new nested list</li></ol></li> <li>Colors</li> </ul>