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

Tonya Davis
Tonya Davis
1,313 Points

Make the text inside each list item a link. The first item should link to cakes.html, the second to pies.html and the

what am I doing wrong?

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

2 Answers

You need to move the text inside the <a> tags.

This works for me.

<ul>
    <li><a href="cakes.html">cakes</a></li>   
    <li><a href="pies.html">pies</a></li>
    <li><a href="candy.html">candy</a></li>
</ul>

Otherwise your links would be empty with no text. You would just have an invisible link next to the <li> elements.

I made a quick little codepen to show you why you should put the text inside the <a> tags.

Here: https://codepen.io/timlong454/pen/QVpJRV

I hope this is helpful!

Tonya Davis
Tonya Davis
1,313 Points

OMG..... Thank You! I went to bed on this one-whew.

You only have one opening <li> tag. There should be one for each item in that list.

Let me know if you need a code example!

Tonya Davis
Tonya Davis
1,313 Points

When I had opening tag for each item, I still got the same message that the pie.html is incorrect