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

Paul Feric
PLUS
Paul Feric
Courses Plus Student 724 Points

nested list

i have done most of the questions right but now its asking me to add a nested order to list to shapes (the item example for the unordered list) how do i add a nested order list and what does it look like?

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>

1 Answer

Here is an example of a nested list:

<ol>
  <li>Item 1</li>
  <li>Item 2
    <ol>
      <li>Subitem 1</li>
      <li>Subitem 2</li>
    </ol>
  </li>
  <li>Item 3</li>
</ol>

This will output:

 - Item 1
 - Item 2
    + Subitem 1
    + Subitem 2
- Item 3

Note that the subitems have "Item 2" as their parent node.