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

Deleted User

Nested Ordered List HTML LIST challenge

I would like to think I know what I am doing when it comes to html but I for whatever reason am not getting a success on this..It is asking for a nested Ordered list within the shapes list item and even after putting the ol opening and closing tags after the shape list item it is still giving me an error..Am I losing my mind or is there something I am not seeing

11 Answers

James Barnett
James Barnett
39,199 Points

The only valid child element of an ul is an li, so if you want to nest a ol inside of a ul it firsts has to be nested inside of an li

 <ul>
    <li></li>
    <li>
        <ol>
            <li></li>
            <li></li>
        </ol>
    </li>
    </li></li>
</ul>

Here is the correct answer: remove one pair </li><li> from the above post. You will get it. see message below: Well done! You're doing great!

<ul>
  <li>Shapes 
    <ol>
      <li></li>
      <li></li>
    </ol>     
  </li>
  <li>Colors</li>
</ul>
James Barnett
James Barnett
39,199 Points

@Blake - To make this easier for others to find please consider adding the html &code challenge tags.

Deleted User

Yes I agree I will add it but I believe there must be a bug or something because I have used that and I am still not getting the correct answer even though I have added the correct syntax of tags...hmm

James Barnett
James Barnett
39,199 Points

As you didn't mention it, I'm guessing you are referring to the HTML Lists code challenge.

James Barnett
James Barnett
39,199 Points

@Blake - 2 tips that can help get your questions answered faster

  1. Posting a "working" example of your code using something like codepen.io
  2. Providing a link to the code challenge you are having issues with
Deleted User

ah scratch my other comment, i see what it is now..my other code was presenting the same result as a nested ordered list but I didnt have to wrap it in the li tags of the shape list item for it to work

James Barnett Don't delete the right answer, I'd rather not sit and try something 100x's. Especially, when my nested list is correct in the preview window. We can all learn from our mistakes by reading others code.

if you add the <li></li> outside<ol></ol>. it just won't work and make things worse. See the message below. What could be wrong?? Oops! It looks like Task 4 is no longer passing.

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

anyway, I think the above one was wrong. But It passed the challenge. I think the below one is correct: But both work well when write in sublime text 3 and open it up with chrome. Please try it out yourself.

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

Hi, I am going insane! Task 5 just will not pass What am I doing wrong?

<ul>
  <ul>new</ul>
  <ul>list</ul>
  <li>Shapes
    <ol>
      <li>A</li>
      <li>B</li>
    </ol>     
  </li>
  <li>Colors</li>
</ul>
James Barnett
James Barnett
39,199 Points

The only valid child element of an ul is an li, so get rid of the 2 uls you have on lines 2 & 3 as they make your markup invalid.