IE8 bottom:0 in position:absolute behaves like position:fixed

时光毁灭记忆、已成空白 提交于 2019-12-12 11:35:37

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/3719764/ie8-bottom0-in-positionabsolute-behaves-like-positionfixed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!