IE8 底部:0 在位置:绝对的行为类似于位置:固定

发布于 2024-09-19 23:27:15 字数 371 浏览 3 评论 0原文

我有一个 DIV 必须始终位于页面的底部/左侧,类似于页脚菜单。

div#bottom_menu
{
  position: absolute;
  z-index: 1;
  left: 0;
  bottom: 0;
  width: 90%;
}

我的页面定义了最小高度,当用户将其缩小到该高度以下时,它会出现滚动条。 问题是,当这种情况发生时,在 IE8 中,div 会向上移动以匹配新的视点最低点,就像它使用position:fixed 时的行为一样。更糟糕的是,当您再次向下滚动时,元素不会向下移动(如位置:固定),而是可笑地停留在页面中间。这在 Firefox、Opera 和 Chrome 中完美运行。这是一个已知的 IE 错误吗?如何解决它?

I have a DIV that must always stay on bottom/left of the page, something like a footer menu.

div#bottom_menu
{
  position: absolute;
  z-index: 1;
  left: 0;
  bottom: 0;
  width: 90%;
}

My page has min-height defined and when the user shrinks it below that it gets scroll bars.
The problem is when it happens, in IE8 the div moves up to match the new viewpoint lowest point like it would behave if it were with position: fixed. Worse than that, when you scroll down again the element does not move down (like in position: fixed) but ridiculously stays in the middle of the page. This works perfectly in Firefox, Opera and Chrome. Is that a known IE bug and how to work around it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吹梦到西洲 2024-09-26 23:27:15

太棒了,我因超级不受欢迎的问题获得了风滚草徽章。

在等待有人帮助我的同时,我自己解决了这个问题(像往常一样)。我通过将 Bottom_menu 放入与旧容器非常相似的包装 div 中来做到这一点,唯一的区别是它没有溢出:隐藏;并且并不直接在体内。由于某种奇怪的原因修复了它。也许它会对某人有所帮助。

Great, I got Tumbleweed badge for super unpopular question.

While waiting someone to help me here I solved it myself (as usual). I did it by putting bottom_menu in a wrapper div pretty similar to the old container, only difference is that is has no overflow: hidden; and is not directly inside the body. That fixed it by some strange reason. Maybe it will help somebody.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文