首页 > 开发 > CSS > 正文

多种方法解决min-width 不兼容ie6的问题

2024-07-11 08:34:43
字体:
来源:转载
供稿:网友

方法一:


height:auto!important;
height:580px;
min-height:580px;

把以上三行代码加到需要最小宽度的div里即可,原理是使用IE6本身的BUG(当块级元素内部的东西超出此块级元素的高度时,块级元素的高度会被撑开,也就是说IE6中的height属性本身就等同于min-height)。

方法二:


min-height:200px;
_height:200px;

方法三:


#min-width{
min-width:900px;
_width:expression((document.documentElement.clientWidth||document.body.clientWidth)<900?”900px”:””);
line-height:200px;
background:#ccc;
}

方法四:


#mpage{
width:100%;
min-width:980px;
position:relative;
_width: expression(((document.compatMode && document.compatMode==’CSS1Compat’)? document.documentElement.clientWidth : document.body.clientWidth) < 980? ‘980px’ : ‘auto’);
}

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表