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

Anthony Sharman
Anthony Sharman
97 Points

Not exactly sure what I am doing wrong here, I can make targets into an unordered list, a .html, not a link apparently

So i was under the assumption that to make something a website you add <a href="http://Cakes.html" target=" _blank"> <li>Cakes</li> and so on. am i missing something?

index.html
<!DOCTYPE html>
<html>
  <head>
    <title>Lists and Links</title>
  </head>
  <body>
  <ul>
    <a href="http://Cakes.html" target="_blank"<li>Cakes</li>
    <a href="http://pies.html" target="_blank"<li>Pies</li>
    <a href="http://Candy.html" target="_blank"<li>Candy</li>
    </ul>  
  </body>
</html>

7 Answers

Steven Parker
Steven Parker
229,644 Points

Be sure your "a" tags are complete (both start and end tags are present, and all tags are enclosed with "<" and ">" symbols). Also be sure to place your "a" elements entirely inside the list item elements.

Steven Parker
Steven Parker
229,644 Points

Here's a generic one:

    <li><a href="some_url" >Item Name</a></li>

Note that there is both a starting <a> tag and ending </a> tag surrounding the name that will become the link, and the whole thing is inside the list item tags.

Anthony Sharman
Anthony Sharman
97 Points

Can i have an example that i can add to my notes

Steven Parker
Steven Parker
229,644 Points

OK, I added a comment to my answer with an example.

What Steven was saying is this: <ul> <li><a></a></li> </ul>

Ben Reynolds
Ben Reynolds
35,170 Points

Another thing worth noting here, when your link points to another page within the same site you don't need "http://". If the linked page is in the same folder as the current page your href can just be the file name.

Anthony Sharman
Anthony Sharman
97 Points

How would that look then without the multiple http://

Ben Reynolds
Ben Reynolds
35,170 Points

Just like Steven's example, you'd just have to swap the "some_url" part with the file the link points to:

    <li><a href="some_file.html">Item Name</a></li>
Anthony Sharman
Anthony Sharman
97 Points

Thank you one and all