元素在 IE7 窗口调整大小时消失

发布于 2024-08-17 08:20:22 字数 293 浏览 2 评论 0原文

我正在对这个网页进行编码。 http://www.nomizine.com/misc/tbs/default.html

除了 IE7 之外,它在任何地方都呈现良好。当我调整浏览器窗口大小时,顶部导航、左侧的指南针和右侧的订阅块消失。

知道如何修复它吗?顺便说一句,我已经尝试过 HasLayout 技巧,如 Zoom:1、clear:both 等,但似乎没有任何效果。

I am coding this web page. http://www.nomizine.com/misc/tbs/default.html

It renders well everywhere except for IE7. When I resize the browser window, top navigation, the compass on the left and subscribe block on the right disappears.

Any idea how to fix it? BTW, I have already tried HasLayout tricks like zoom:1, clear:both etc but nothing seems to work.

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

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

发布评论

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

评论(2

捶死心动 2024-08-24 08:20:22

我认为问题在于罗盘是绝对定位的,但容器(本例中的 td)不是绝对或相对定位的。

由于绝对定位的元素是相对于最近的相对或绝对定位的父级定位的,因此它可能是 IE7 在尝试重新计算(由于调整大小)放置此元素的位置时出错。

我建议您用 div 包装 #compass div有 position:relative

[EDIT]

好吧,罪魁祸首是 css 文件中的 #header_bg 规则。
只需删除位置:相对,一切都会恢复正常:)

#header_bg{
   background: url(../images/header_bg.png) no-repeat center top;
   /*position:relative;*/
 }

I believe the issue is the fact that the compass is absolute positioned but the container (the td in this case) is not absolute or relative positioned..

since the absolute positioned elements are positioned in relation to the nearest relative or absolute positioned parent, it could be that IE7 messes up when trying to reclculate (due to the resize) where to put this element..

i would suggest you wrap the #compass div with a div that has position:relative

[EDIT]

ok the culprit is #header_bg rule in the css file..
just remove the position:relative and all will be back to normal :)

#header_bg{
   background: url(../images/header_bg.png) no-repeat center top;
   /*position:relative;*/
 }
〃温暖了心ぐ 2024-08-24 08:20:22

这对我有用。

#header_bg{
            background: url(../images/header_bg.png) no-repeat center top;
            height:100%;
            margin:0 auto;
            position:relative;
            text-align:center;
            width:100%;         
    }

This is what worked for me.

#header_bg{
            background: url(../images/header_bg.png) no-repeat center top;
            height:100%;
            margin:0 auto;
            position:relative;
            text-align:center;
            width:100%;         
    }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文