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. Can't get the objective to work...

Hi

I'm currently in web design track. And right now on HTML learning lists. I cant get the objective (objective-question 4) to work. I should make an ordered list under Shapes. What am I doing wrong?

I'm writing my code like this:

<h1>HTML Lists Challenge</h1>

<!-- Write your code below -->
<ol>
  <li>Stop</li>
  <li>Drop</li>
  <li>Roll</li>
</ol>
<ul>
  <li>Shapes</li>
   <ol>
    <li>Hi</li>
    <li>Bye</li>
   </ol>     
  <li>Colors</li>

</ul>

</body> </html>

And now I want to ask you a question: How did you format your code like that? Mine just shows up as a line of tags.

Wrap your code with 3 backticks (```) on the line before and after. If you specify the language after the first set of backticks, that'll help us with syntax highlighting.

        ```html
        <p>This is code!</p>
        ```

Thanks Amin! That's great for future posts :-)

/Emil

Any idea why mine looks like this?

    <ul>
         <li>Shapes
            <ol>
              <li>Ordered list item one</li>
              <li>Ordered list item two</li>
            </ol>
          </li>
        <li>Colors</li>
    </ul>

Huh. It displays and formats correctly as a reply, but when I use the answer line it's all crammed together. And on a separate note, I'm unable to edit my replies.

No idea bro... The above code looks great though :-)

3 Answers

The ordered list that you're adding needs to go inside of the same <li> tags as where you've written Shapes, like so:

    <ul>
         <li>Shapes
            <ol>
              <li>Ordered list item one</li>
              <li>Ordered list item two</li>
            </ol>
          </li>
        <li>Colors</li>
    </ul>

(Sorry, I can't figure out how to make the code format correctly.)

Ok :-)

Worked out fine! Must have missed this in the video. Thanks Alexander, for taking the time & helping me out :-)

/Emil

I copied it from the task (programming) window. Ctrl-C & Ctrl-V...Like always. When it appeared on the page, it looked like that.