Home  >  Q&A  >  body text

angular anchor issue - angular anchor issue

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

reply all(1)I'll reply

  • PHP中文网

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

    See if you have done fixabsolute positioning on banner or topbar
    . If so, your jump anchor point will definitely not be able to correspond accurately

    Solution
    Just set the following code to the container where each id element is located

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

    reply
    0
  • Cancelreply