我正在尝试针对 ie 6 的最小宽度的解决方法。
看下面的代码
<!--[if lte IE 6]>
<style type="text/css">
.left_2 {width:expression(document.body.clientWidth < 137? "135px": "21.5%" ) !important; padding-left:7.5px; padding-right:7.5px; height:auto; float:left;}
</style>
<![endif]-->
<style type="text/css">
.left_2 { min-width:135px; width:21.5%; padding-left:7.5px; padding-right:7.5px; height:auto; float:left; }
</style>
但是这似乎对 ie6 和 ie7 都没有任何影响。我什至将文档类型设置为严格以使它在 ie 7 上工作...有什么问题吗?
编辑:这是你的意思吗?
<style type="text/css">
.left_2 { min-width:135px; width:21.5%; padding-left:7.5px; padding-right:7.5px; height:auto; float:left; }
</style>
<!--[if lte IE 6]>
<style type="text/css">
.left_2 {width:expression(document.body.clientWidth < 137? "135px": "21.5%" ) !important;}
</style>
<![endif]-->
最佳答案
IE6 看到的内容:
Set "width" to the result of an expression
Set "width" to 21.5%
将条件注释放在常规样式之后,而不是之前。
关于css - Internet Explorer 版本 6 和 7 - 最小宽度问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8906322/