HTML HTML Basics Getting Started with HTML Lists and Links Challenge

The challenge has a bug in the second task, I put the anchor tag in the Pies element but I get an error.

The challenge has a bug in the second task, I put the anchor tag in the Pies element but I get an error.

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>

3 Answers

Joe Nguyen
Joe Nguyen
15,765 Points

It's not really a bug.It's just that your code has a few errors I believe this is what you are looking for to solve the challenge.

<!DOCTYPE html>

<html>

<head>

<title>Lists and Links</title>

</head>

<body>

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

</body>

</html>

Hi there,

You're missing the closing > for the anchor tag for the candy link

Yeah, but tha isn't the error, It is with the archor tag for the pies link

Ah gotcha - it's because your anchor tags are wrapping the list elements. It just wants you to wrap the text inside the list elements, not the <li>'s themselves. It can seem pedantic, but there is a functional difference to the user.