gpt4 book ai didi

css - IE 中的高度显示与 Firefox 不同

转载 作者:行者123 更新时间:2023-11-28 11:50:53 26 4
gpt4 key购买 nike

我在 ie 中显示设置高度时遇到问题。

在我的 css 中,我将侧边栏 div 的高度设置为 2150px;它在 firefox 中显示正常,但在 ie 中不显示完整高度。

如何让ie显示我在ie中设置的高度?

提前致谢

源码在下面

#sidebar_newspr{
width:160px;
min-height:2150px;
margin-top:1px; margin-right:2px;
border-right-style:solid; border-right-color:#900; border-right-width:1px;
float:left;
}
#sidebar_newspr a{
text-decoration:none;
color:#FFF;
font-size:12px; font-family:Verdana,Arial,Helvetica,sans-serif;
}
#sidebar_newspr a:hover{
color:#900;
}

最佳答案

这有点摸不着头脑,因为您没有真正指定要在哪个版本的 IE 中进行测试。不过,min-height 需要 IE7 和 IE8 才能运行在标准模式下。要启用标准模式,您需要使用严格的 !DOCTYPE

来自 the documentation :

In Internet Explorer 7, the min-height/max-height attributes apply to floating and absolutely positioned block, inline-block elements, and some intrinsic controls. They do not apply to non-replaced inline elements, such as table columns and row/column groups. (A "replaced" element has intrinsic dimensions, such as an img or textArea.)

In Internet Explorer 7, this property is enabled only under the strict !DOCTYPE.

IE6 中的

min-height 仅适用于 thtdtr 元素。

关于css - IE 中的高度显示与 Firefox 不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2773234/

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