HTML - Auto navigation with Named Anchors #

12,195

You can append a hash with following the the value of the id attribute of any HTML element. See this example: http://en.wikipedia.org/wiki/Html#Attributes

It links directly to the section about "Attributes". In this section it also discribes the technique :)

Share:
12,195
Moon
Author by

Moon

Updated on June 14, 2022

Comments

  • Moon
    Moon almost 2 years

    well we can have name anchors in our page like the following code

    <!---Some HTML Code-->
    <a href="#Mark_1">Mark 1</a>
    <a href="#Mark_2">Mark 2</a>
    
    <!---After some HTML Code-->
    <a name="Mark_1">
    
    
    <!---After some HTML Code-->
    <a name="Mark_2">
    

    by doing so we provide links that to scroll up and down a page and all but

    I have seen several times on the net that when you click a link and a new page is opened and it contains many subjects but page is scrolled to the desired position.

    HOW THAT IS DONE

    for example, in stackoverflow's recent activity when we click some activity the relevant page is opened and page is scrolled to that activity out of many... this is just an example.. i don't want how stackoverflow does it... what i want how is this done or is there any name for this technique