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

Why is the Code Challenge on HTML Deep Dive Lists failing with the following code?

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

My code:

<!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>one</li>
      <li>two</li>
    </ol>
  <li>Colors</li>
</ul>

</body> </html>

Any suggestions on why I am failing the code challenge? It fails with or without the list items nested to the ordered list.

2 Answers

Alex Heil
Alex Heil
53,534 Points

hey joshua, you get the bummer because you added the ordered list after the list item - when you want to nest the ordered list it has to be before the closing li tag. you can see the full code here: https://teamtreehouse.com/forum/add-a-nested-ordered-list-to-the-shapes-list-item-3?sort=subscribed

hope that helps ;)

I see what you mean. Thank you, Alex! So basically is it just a matter or semantics? In the same way we nest the list items in the original unordered list tags and then closed the unordered list?

Marvin Abella
Marvin Abella
6,378 Points

I agree with Alex. By experience, I always look closely on the prompted challenge and dissect them word by word, most of the time they hint out words with or without the quotes what you NEED to do to answer it. Goodluck Joshua!