Anchor Link HTML



我正在尝试为我的网站设置一个锚链接,以跳转到同一页面上的特定标题。下面是我当前的代码,但是当您选择链接时,没有任何反应。任何帮助都会很棒,谢谢!

Section I want the link to jump to
<div class="heading1">
<h2 style="margin-bottom:-5px;font-size:40px;"><a id="#work"></a>content</h2>
<p style="font-size: 26px;">content</p>
</div>
Link
<div class="contact mobile">
<a href=“#work”>Work</a>
</div>

需要将 href 引用到您要跳转到的div 的 id href="#jump"

<div class="heading1" id="jump">
<h2 style="margin-bottom:-5px;font-size:40px;">content</h2>
<p style="font-size: 26px;">content</p>
</div>
<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
<div class="contact mobile">
<a href="#jump">Work</a>
</div>

兄弟从

属性 id="#work" 中删除哈希,只使用 id="work>

最新更新