<div id="anchorpoint">Some content here</div>
我们如何告诉浏览器跳转到锚点位置100px?@H_502_5@
谢谢.@H_502_5@
<a id="anchorpoint" class="anchor"></a> <div>Some content here</div>
CSS@H_502_5@
.anchor { display:block; padding-top:100px; margin-top:-100px; }
这是对Fixed position navbar obscures anchors的略微修改.优点在于,您不预先填充实际容器的填充和边距.@H_502_5@