Is there such a html code as this...?

  • Thread starter Thread starter Lola
  • Start date Start date
L

Lola

Guest
I would like to make a link that takes to a certain part of a page. What is the html code for this?
 
definitely :)
you have to use an anchor identifier

put this where you want to jump back to (for instance, if you want to be able to go back to the top of the page, put this code at the top of the page):

<a id="top">

and this could go at the bottom (it will appear as a link and when you click on it, you'll go to where the identifier is):

<a href="#top">Top</a>

of course it can be called anything you want, just make sure you leave the # in the last one because that's what lets it know that it's an identifier !

you can also do this with different pages if you wanted to be able to click a link to go back to a certain place on the first page. in this case you'd use the same concept, but on the second page you would have to make sure your path was right, so your tags would look like this:

first page: <a id="middle_paragraph">

second page: <a href="../first_page.html#middle_paragraph">

hope this helped!
 
Back
Top