General offset for all anchors in HTML?

I have some anchor elements, but they are in absolute position div and the content of the div is so large that it scrolls inside (overflow:auto).

All entries in the div have an anchor on top, but if I go to this anchor I have the element I wanted to directly on top of the side, but I want it in the center. I need something like an offset so I can jump higher than normal.


你总是可以添加另一个div来环绕它,然后做类似的事情

.wrapperdiv{
   position:relative;
   top:-10px;
}

您可以尝试使用Javascript滚动来更正位置。

链接地址: http://www.djcxy.com/p/89002.html

上一篇: 如何将平滑滚动添加到Bootstrap的滚动间谍功能

下一篇: HTML中所有锚点的一般偏移量?