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

You need to set the 'href' attribute of the first <a> element to 'cakes.html'.

index.html
<!DOCTYPE html>
<html>
  <head>
    <title>Lists and Links</title>
  </head>
  <body>
  <ul>
    <a>
    <li>Cakes.html</li<a>
      <a>
      <a href="https://teamtreehouse.com">treehouse</a>
      <li><a href="cats.html">cats</a></li>
      <li><a href="dogs.html">dogs</a></li>
 <li> Pies.html</li<a>
        <a href="https://teamtreehouse.com">treehouse</a>
      <li><a href="cats.html">cats</a></li>
      <li><a href="dogs.html">dogs</a></li>
 <li> Candy.html</li<a>
        <a href="https://teamtreehouse.com">treehouse</a>
      <li><a href="cats.html">cats</a></li>
      <li><a href="dogs.html">dogs</a></li>
    </ul>
  </body>
</html>

3 Answers

Maxwell Newberry
Maxwell Newberry
7,693 Points

There are three cases in your code where you accidentally forgot to end the list item.

<li>Cakes.html</li<a>
<li>Pies.html</li<a>
<li>Candy.html</li<a>

Additionally, before your Cakes.html list item, you have an open anchor <a> tag. Make sure you check this.

Hi. Remember, anchor tags are used to define the beginning and end of a hypertext link. Anchor tags are not self closing. There are instances where you placed your anchor tags incorrectly or in inappropriate places. For example, under your opening tag of unlimited list <ul> this is what you have, <a> <li>Cakes.html</li<a> <a>

Your code should look like this;

<ul> <li><a href="cake.html">Cake</a></li> </ul>

Then put all your list items between the unordered list. I think there is also a problem in your closing tags around the list items. You have to close each of the closing tags; <li></li>

<!DOCTYPE html>
<html>
  <head>
    <title>Lists and Links</title>
  </head>
  <body>
  <ul>
    <li><a href="Cakes.html">Cakes</a></li>
      <a href="https://teamtreehouse.com">treehouse</a>
      <li><a href="cats.html">cats</a></li>
      <li><a href="dogs.html">dogs</a></li>
 <li><a>Pies.html</a></li>
        <a href="https://teamtreehouse.com">treehouse</a>
      <li><a href="cats.html">cats</a></li>
      <li><a href="dogs.html">dogs</a></li>
 <li> <a>Candy.html</a></li>
        <a href="https://teamtreehouse.com">treehouse</a>
      <li><a href="cats.html">cats</a></li>
      <li><a href="dogs.html">dogs</a></li>
    </ul>
  </body>
</html>

im not sure but i think this is what you want let me know if this helped