HTML中所有锚点的一般偏移量? [英] General offset for all anchors in HTML?

查看:109
本文介绍了HTML中所有锚点的一般偏移量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些锚点元素,但它们处于绝对位置div,并且div的内容非常大以至于可以滚动(overflow:auto)。

在div中的所有条目都有一个锚点,但是如果我去这个锚点,我有我想直接在边上的元素,但我想要它在中心。我需要类似偏移的东西,所以我可以跳得比平常高。

然后做一些类似的事情:

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


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.

解决方案

you could always add another div to wrap around it, and then do something like

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

这篇关于HTML中所有锚点的一般偏移量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆