Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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,679 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