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

How do you add a nested ordered list

Doing quiz and need to add a nested order list to an unordered list item

index.html
<!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>

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

  </body>
</html>

2 Answers

Erik McClintock
Erik McClintock
45,783 Points

Thomas,

If you go back a couple of videos (to this one), you can see how to nest lists.

However, for quick reference, you would nest it just like you would nest any other element:

<div>
    <ul><!-- this ul is nested inside the div above it -->
        <li>Shapes <!-- this li is nested inside the ul -->
            <ol><!-- this ol is nested inside the li (it is between the li's opening and closing tags, i.e. it is nested inside it) -->
                <li>Square</li><!-- these lis are nested inside the ol -->
                <li>Circle</li>
            </ol>
        </li>
        <li>Colors</li>
        <li>Another list item</li>
    </ul>
</div>

I recommend rewatching the previous videos to make sure you absorb all of this information and truly understand it, though, as these are important, core concepts that you need grasp!

Erik

Thank you!