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 HTML Lists HTML Lists

Chris Gains
Chris Gains
2,888 Points

Can anyone take a look at my code to question - Add a nested ordered list to the "Shapes" list item.

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

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

7 Answers

Callum King
Callum King
6,470 Points

There is no code Chris? Use the 3 backticks (```) on the line before and after your code.

Chris Gains
Chris Gains
2,888 Points

Hi Callum

Here it is

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

<h1>HTML Lists Challenge</h1>

<!-- Write your code below -->
<dl>
  <ol>
    <li>Stop</li>
    <li>Drop</li>
    <li>Roll</li>
  </ol>

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

</body> </html>

Hi Chris,

Looks like you may be mixing different types of list together which is why its not working.

An unordered list looks like:

<ul>
    <li>Example Content</li>
    <li>Example Content 2</li>
</ul>

An ordered list looks like:

<ol>
    <li>Example Content</li>
    <li>Example Content 2</li>
</ol>

A definition list looks like:

<dl>
  <dt>Title</dt>
    <dd>Description</dd>
  <dt>Title 2</dt>
    <dd>Description 2</dd>
</dl>

A nested ordered list (an ordered list inside an ordered list), should look something like:

<ol>
    <li>Content 1</li>
    <li>Content 2:
        <ol>
            <li>Nested content 1</li>
            <li>Nested content 2</li>
        </ol>
    </li>
    <li>Content 3</li>
</ol>

Hope this helps!

Callum King
Callum King
6,470 Points

The ol tags should be within the li tags for the shapes list.

    <ul>
      <li>Shapes
        <ol></ol>
      </li>
      <li>Colors</li>
    </ul>
Chris Gains
Chris Gains
2,888 Points

I was getting confused by adding the </li> after 'Shape'

Chris Gains
Chris Gains
2,888 Points

I was getting confused by adding the </li> after 'Shape'