多种方法解决min-width 不兼容ie6的问题
多种方法解决min-width 不兼容ie6的问题
发布时间:2016-12-27 来源:查字典编辑
摘要:方法一:height:auto!important;height:580px;min-height:580px;把以上三行代码加到需要最小宽...

方法一:

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');

}

推荐文章
猜你喜欢
附近的人在看
推荐阅读
拓展阅读
相关阅读
网友关注
最新 Div+Css教程学习
热门 Div+Css教程学习
网页设计子分类