源页面代码:
<a href="${context_path}/rss-footer-documents#aboutUs">About Us</a>
目标页面代码:
<h3><div id="aboutUs" ">About Us</div></h3>
当点击“关于我们”链接时,它指向 url/rss-footer-documents.html#/termsOfRegistration。
我希望它指向/rss-footer-documents.html#termsOfRegistration。
由于它会自动在 # 之后添加/,因此它只是导航到页面而不是特定部分。
请告诉我如何删除 url 中自动添加的/。
最佳答案
您是否试过像这样简单地在 anchor 链接上添加斜杠?
<a href="${context_path}/rss-footer-documents/#aboutUs">About Us</a>
关于html 链接导航到另一个页面的部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26947280/