解決方案:
參照 stackoverflow 的做法,在主體內容前加一個暗錨
<div class="anmao" id="experts"></div>
<div>主體內容</div>
將錨點進行偏移,並隱藏占位:
.anmao{ height 0; position relative top -80px }
如下:暗錨在頂部,並占位導航欄高度
解決方案:
參照 stackoverflow 的做法,在主體內容前加一個暗錨
<div class="anmao" id="experts"></div>
<div>主體內容</div>
將錨點進行偏移,並隱藏占位:
.anmao{ height 0; position relative top -80px }
如下:暗錨在頂部,並占位導航欄高度
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。