锚 link 位置 - Wordpress

anchor link position - Wordpress

我在 this 网站的边栏中有一个锚点。当我单击 link 时,它会转到右侧页面,锚点也可以使用,但我的菜单位于锚点之上,因此您看不到标题。我该如何解决这个问题,以便用户可以看到标题?

  <h3><a href="/Structuur-te-huur">Structuur te huur</a></h3>
<ul>
    <li><a href="/Structuur-te-huur/#structuur-te-huur">Structuur te huur</a></li>
    <li><a href="/Structuur-te-huur/#procesbegeleiding">Procesbegeleiding</a></li>
    <li><a href="/Structuur-te-huur/#projectmanagement">Projectmanagement</a></li>
    <li><a href="/Structuur-te-huur/#training">Training</a></li>
</ul>

css

#secondary .widget ul, #footer-widgets .widget ul{
    list-style-type: '- ';
    color: #fff;
    padding: 20px;
    margin: 0;
}
#secondary .widget ul li a {
    color: #fff;
    font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
    font-weight: 300;
    letter-spacing: 1.3px;
}
#secondary .widget h3{
    padding: 20px;
    font-family: "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
    font-weight: 800;
}
/* widget paars*/
#secondary .widget:nth-child(2),
#secondary .widget:nth-child(7){
    background: #B167B3;
}
#secondary .widget:nth-child(2) h3,
#secondary .widget:nth-child(7) h3{
    background: #A263A4;
}
/* Oranje*/
#secondary .widget:nth-child(3){
    background: #FF9D29;
}
#secondary .widget:nth-child(3) h3{
    background: #FA9624;
}
/* Groen */
#secondary .widget:nth-child(4){
    background: #54D7C1;
}
#secondary .widget:nth-child(4) h3{
    background: #14C4A8;
}
/* Blauw */
#secondary .widget:nth-child(5){
    background: #63B9FC;
}
#secondary .widget:nth-child(5) h3{
    background: #36A6F6;
}
/* Rood */
#secondary .widget:nth-child(6){
    background: #F0524E;
}
#secondary .widget:nth-child(6) h3{
    background: #ED413A;
}

要么在你跳转到的地方的顶部添加一些顶部填充,这样你的菜单就不会覆盖它,要么像这个问题一样使用 javascript... Make anchor link go some pixels above where it's linked to

如果它不会对您的设计造成太大伤害,填充可能是最好的选择 - 无需添加不必要的 javascript。