HTML Introduction to HTML and CSS HTML: The Structural Foundation of Web Pages and Applications Test: Creating an HTML Element

Innocent Chipwere
Innocent Chipwere
466 Points

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
155,473 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,123 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
155,473 Points

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