gpt4 book ai didi

html - 为什么我的内容在兼容模式下会消失在标题后面?

转载 作者:太空宇宙 更新时间:2023-11-04 15:39:50 25 4
gpt4 key购买 nike

在兼容模式下运行以下布局时,内容会消失在固定标题后面。有什么办法可以防止这种情况发生吗?

参见 jsfiddle here并在 IE 中切换兼容模式。当不在兼容模式下时,布局在 chrome 和 IE9 中工作正常。

标题CSS基本上是:

#headerContainer
{
position: fixed;
top:0px;
z-index:999;
background:green;
width: 100%;
}

内容 css 是:

#container{
overflow:hidden;
padding-left:480px; /* The width of the rail */
margin-top: 135px;
background: red;
}

它是固定流式布局(左栏是固定的),带有固定的页眉。向下滚动时,我希望页面的内容消失在标题下方。

最佳答案

IE 兼容模式的快速修复:

#container{
overflow:hidden;
padding-left:480px; /* The width of the rail */
margin-top: 135px;
background: red;
*position:relative;
*top:135px;
}

我已经为 IE7 使用了 CSS hack(使用 *)。 fiddle :http://jsfiddle.net/keaukraine/phPAN/

关于html - 为什么我的内容在兼容模式下会消失在标题后面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12282214/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com