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

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.