Jump to content

Question: Link to parts of a page

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
skilletsteve

skilletsteve

    Learning Programmer

  • Members
  • PipPipPip
  • 45 posts
How would one go about making a link that leads to a different part of a page?
(example: at the bottom of a page you click top to return to the top of the page, without actually reloading the page)
Help is appreciated.

#2
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Ok here is the code:-


<html>

<a name="GotoTop"></a>Here is the Top</p>

<br><br><br><br><br><br><br><br><br><br>

<br><br><br><br><br><br><br><br><br><br>

<br><br><br><br><br><br><br><br><br><br>

<br><br><br><br><br><br><br><br><br><br>

<br><br><br><br><br><br><br><br><br><br>

<br><br><br><br><br><br><br><br><br><br>

<br><br><br><br><br><br><br><br><br><br>

<a href="#GotoTop">Go to the Top</a></p>

</html>


Explanation:
Lets say that instead of all those <br> there is your site content etc... make


<a name="GotoTop"></a>Here is the Top</p>


on the top ( or where you want to return )
and make the


<a href="#GotoTop">Go to the Top</a></p>


at the bottom or so then when you click the Go to the Top you will be taken to the top!
Hope this helps :)

#3
skilletsteve

skilletsteve

    Learning Programmer

  • Members
  • PipPipPip
  • 45 posts
Allright, so if I understand correctly, a name can be any variable at any place on the page, then from any other link on the page it will go to there. Do I understand correctly?

#4
TcM

TcM

    Writes binary right handed and hex left handed

  • Members
  • PipPipPipPipPipPipPipPipPip
  • 11,147 posts
Yeah just set a name insted of
<a name="GotoTop">
GotoTop can be ANYTHING
and thn call it from another link by making
<a href="#GotoTop">
ok? hope this helped!