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 Introduction to HTML and CSS (2016) HTML: The Structural Foundation of Web Pages and Applications Test: Creating an HTML Element

Set the anchor tag so that it points to the top of the page. (Hint: you'll need the href attribute.)

<a href="#">

index.html
<!doctype>
<html>
  <head>
    <title>My trip to Spain</title>
  </head>
  <body>

    <img src="images/spain.jpg"alt="A picture of me in Spain">
    <P> Here is a picture of me in Spain last summer!</p>
        <li>a> href="http://www.top.com">Go back to the top of the page. 

  </body>
</html>
Wally Bryan
Wally Bryan
4,350 Points

I think the issue is that you have not closed your <a href> (look just after the <li>) -

So the link is broken -

It should read

<li> <a href="XXXX"> To Top </a> </li>

Also if you are trying to link one link to another on the same page you would need to create two links on that page with both the same link location.

This could be

<a href="to-top"> (a link at the top of the page)

< a href="to-top"> (at the bottom of the page)

This will then have the page jump from the bottom to the top

2 Answers

Steven Parker
Steven Parker
231,236 Points

It seems you've put the correct solution on the line just before where your code block starts. The one showing this:

<a href="#">

A few other hints:

  • use lower case for tag names
  • don't change anything in the challenge not asked for (like adding an "li" tag)
  • relative links (such as into the same document) won't have "http://" in them
Amanda Alonzi
Amanda Alonzi
2,620 Points

<a herf="#top"></a> this is what i have entered but its wrong so i am having a hired time figuring out why.

Steven Parker
Steven Parker
231,236 Points

The attribute name should be "href" ("r" before "e") instead of "herf".