Heim  >  Fragen und Antworten  >  Hauptteil

Problem mit dem Winkelanker - Problem mit dem Winkelanker

  $location.hash('feature');
    $anchorScroll();
    请教各位大神,我用这种方式定义锚点为什么和我定位的id元素有偏差?
巴扎黑巴扎黑2674 Tage vor724

Antworte allen(1)Ich werde antworten

  • PHP中文网

    PHP中文网2017-05-27 17:46:29

    看看你是不是对banner或是topbar做了fix绝对定位
    如果是的话,你做跳转锚点肯定是没法对应准确的

    解决方案
    对每个id元素所在的容器同时设置如下代码就可以了

    padding-top:80px;
    margin-top:-80px

    Antwort
    0
  • StornierenAntwort