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

Code gives error? <ul> <LI>Shapes</LI> <ol> <li>Circle</LI> </ol> </ul>

Instructed to insert ordered list into "shapes", which is unordered list. My code is producing an error. Why?

index.html
<!DOCTYPE html>
<html>
  <head>
    <title>HTML Lists Challenge</title>
  </head>

</html><body>

    <h1>HTML Lists Challenge</h1>

    <ol>
      <LI>Stop</LI>
      <LI>Drop</LI>
      <LI>Roll</LI>
    </ol>
    <ul>
      <LI>Shapes</LI>
         <ol>
           <li>Circle</LI>
         </ol>
      <LI>Colors</LI>   
         </uL>    
    </ul>

  </body>

Your section

<LI>Shapes</LI>
         <ol>
           <li>Circle</LI>
         </ol>
      <LI>Colors</LI>   

has a small differentiation, you started using <LI> but before circle you used <li> but end it with </LI>.

Try using similar text.

3 Answers

Jennifer Cyr
Jennifer Cyr
2,302 Points

Try:

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

Hi,

You want to make sure you're using lowercase letters when you declare the list items; use "li" rather than "Li".

<ol>
    <li>list item 1</li>
    <li> list item 2</li>
</ol>

Hope that helps! Take care, Kaleena

You should probably wrap your ol tag with an li. The ul is expecting a bunch of lis inside it, and suddenly it comes across an ol, which it doesn't know what to do with. Wrapping your ol in an li will make sure the outer ul will have no direct children that are not lis.

Note - edited because my tags weren't showing up.

Also note - capitalization doesn't matter in HTML, but it is nice to be consistent.