anchor linking to a certain position of the page

前端 未结 7 2109
渐次进展
渐次进展 2021-01-06 18:06

I have an anchor link which links to another page. When it is clicked, by default it goes to the top of the next page. I want it brought to a certain position of the page. H

相关标签:
7条回答
  • 2021-01-06 18:45

    Use an anchor like this in your target document:

    <a name="anchor1"></a>
    

    or

    <a id="anchor1"></a>
    

    and in your source document:

    <a href="http://www.example.com/some/page.html#anchor1">Go to anchor 1</a>
    

    or within the same document:

    <a href="#anchor1">Go to anchor 1</a>
    
    0 讨论(0)
提交回复
热议问题