Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在子页面上有锚点:
<a name="#top"> </a> <a href="#top">Back to top</a>
它适用于索引页面,但不适用于子页面。
始终链接 -site.com/#top
site.com/#top
也许是 JavaScript 的问题(例如,Fancybox 等)
更新:固定 -<base href="site.com/" />在<head>
<base href="site.com/" />
<head>
不应该是这样吗?(名字上没有#)
<a name="top"> </a> <a href="#top">Back to top</a>
或者,您可以这样做:
<div id="top">Some content</div> <a href="#top">Back to top</a>