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 Basics Getting Started with HTML Lists and Links Challenge

Justin Warren
Justin Warren
7,805 Points

A bit of help please!

Not sure what I'm doing wrong in the formatting of this ul. Thanks!

index.html
<!DOCTYPE html>
<html>
  <head>
    <title>Lists and Links</title>
  </head>
  <body>
  <ul>
    <a href='cakes.html'><li>Cakes</li></a>
    <a href='pies.html'><li>Pies</li></a>
    <a href='candy.html'><li>Candy</li></a>
  </ul> 
  </body>
</html>

This looks correct to me. A few things that could be nit-pic that could cause the issue, but this is just a guess

  1. You might move the<a> link to inside the <li> and just have it around the Text. For example
<ul>
<li><a href="cakes.html">Cakes</a></li>
</ul>
  1. Some people prefer that you use double quotes when defining the attributes instead of the single quote. Not sure if that is due more to the way this forum formats code or how you actually wrote it.

Neither of these things make a big difference in implementation, but could possibly cause a problem with code checking algorithms.

3 Answers

This looks correct to me. A few things that could be nit-pic that could cause the issue, but this is just a guess

  1. You might move the<a> link to inside the <li> and just have it around the Text. For example
<ul>
<li><a href="cakes.html">Cakes</a></li>
</ul>
  1. Some people prefer that you use double quotes when defining the attributes instead of the single quote. Not sure if that is due more to the way this forum formats code or how you actually wrote it.

Neither of these things make a big difference in implementation, but could possibly cause a problem with code checking algorithms.

Michael Maitoza
Michael Maitoza
3,805 Points

Hi Justin, Here is your code: <!DOCTYPE html> <html> <head> <title>Lists and Links</title> </head> <body> <ul> <a href='cakes.html'><li>Cakes</li></a> <a href='pies.html'><li>Pies</li></a> <a href='candy.html'><li>Candy</li></a> </ul> </body> </html>

What I think needs to happen is that these lines here are the source of the issue: <ul> <a href='cakes.html'><li>Cakes</li></a> <a href='pies.html'><li>Pies</li></a> <a href='candy.html'><li>Candy</li></a> </ul> Try looking at how the <li></li> are placed. I think if you take a look you'll see that the <li></li> must be placed outside of the <a> tags.

Justin Warren
Justin Warren
7,805 Points

Thanks for the help guys!