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

Joseph Yehulugeta
Joseph Yehulugeta
6,022 Points

Need help setting up hyper link to listed item. I know how to use href but need help in regards to using with list.

Basically i know that it's <a href="cakes.html"></a>

but how do use in with the list?

<li></li>

It started off as

<li>Cakes</li>

How do i add the hyper link while keeping the item as a list, When i preview there are hyperlinks to the items but the links dont work and my work is invalid/incorrect.i do enjoy the critical thinking required but i do need help.

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>

1 Answer

angel moreta
angel moreta
2,912 Points

set the <a> tags inside the <li> tags and of course inside <ul></ul> tags

try: <li><a href="Desserts.html">Desserts</a></li>

Joseph Yehulugeta
Joseph Yehulugeta
6,022 Points

Thanks it worked makes sense to put the <li> tags on the outside.