html中书签(锚链接)的使用

时间:2026-02-14 04:23:28

1、同一个web页面链接首先设计书签

<a name=”top”></a> 

在不同位置定义

<a href=”#top”>返回到top位置</a>

2、不同的页面之间转接

如果是在不同的页面之间链接时要在href属性中加上网页名称。

First.html中定义了书签

<a name=”top”>Top的位置</a>

3、现在要从Second.html中转入First.html并且将位置定到top所在的位置

可以设置

<a href=”first.html#top”>return first Top</a>

© 2026 海能知识库
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com