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

Michelle Mok
Michelle Mok
3,488 Points

nested lists.

for challenge task 5 of 6, would this coding be acceptable for nested lists?

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

4 Answers

The ordered list needs to be nested inside the Shapes li element:

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

Hi MIchelle,

The nested <ol> has to be contained inside your li So it should come after "Shapes" but before your closing </li>

The only direct children of a <ul> are <li>'s or scripts. You can't have a <ol> as a direct child of a <ul>

Michelle Mok
Michelle Mok
3,488 Points

Thanks!

Would the same format apply if the <ul> element were to be nested within an <ol> element? Is this correct?

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

Yes, it would.

Also, please note that when posting code on the forums, you have to wrap it with three backticks (```), so that it's visible and properly formatted. I've edited your post to add them.

Check the Markdown Cheatsheet (under the post text area) for more info and an example of usage.

Michelle Mok
Michelle Mok
3,488 Points

I was wondering about how to show the code. THANKS!!