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

having trouble with href, anyboudy can help me

index.html
<!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>
Austin Whipple
Austin Whipple
29,725 Points

Cleaned up your question a bit to remove the duplicate code.

4 Answers

Steven Parker
Steven Parker
231,269 Points

An ending tag has a slash (/) between the first angle and the tag name. So instead of "<a/>" your anchor elementss should be closed with "</a>". The other ending tags you added are correct.

Also heed Cynthia's advice about removing that stray period after the third file name.

good eye on that one

Cynthia Norwood
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Cynthia Norwood
Front End Web Development Techdegree Graduate 15,214 Points

There is a period at the end of the 3rd li(html.) that should be removed. Also after the closing </a> you can add whatever work/text you like for the user to click on. If the link is going to a website it may need to look like this example. <a href="https://www.w3schools.com">Visit W3Schools</a> or to a local file make it mirror this <a href="C:\Programs\sort.mw">Link 1</a> <a href="C:\Videos\lecture.mp4">Link 2</a>

Watch out for that extra period at the end of "candy.html". Also clean up your nesting of your code it will help you spot errors later on and is important when working with another dev. - Keep rockin

<!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> 
Herbie Dodge
Herbie Dodge
15,985 Points

It looks like you have an extra period behind your candy href; other then that everything looks fine