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

Need help making anchor tag.

question was anchor tag go back to the top of the page. <a> herf="top" go back to the top of the page<a/>

need help How do I add a class called "main-pg" to the paragraph element.

2 Answers

Gabriel Plackey
Gabriel Plackey
11,064 Points

Firstly, it's href, not herf. Probably just a typo. Then the href needs to be in the anchor tag

<a href="top"> go back to the top of the page<a/>

Lastly, to take make it go to the top of the page we will change the href to #. Like

<a href="#"> go back to the top of the page<a/>

Oh and your closing tag is incorrect. The slash will come right after the start of the closing tag.

<a href="#"> go back to the top of the page</a>

yes I saw where I misspelled href...let me try your suggestions will let you know if work. Thanks!

It's : <a href="#top"> go back to the top of the page</a>

Gabriel Plackey
Gabriel Plackey
11,064 Points

You must have top set as an id for something at the top of the page then.