多種方法解決min-width 不兼容ie6的問題

方法一:

復制代碼代碼如下:
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.compatModedocument.compatMode==’CSS1Compat’)? document.documentElement.clientWidth : document.body.clientWidth)980? ’980px’ : ’auto’);
}

相關經驗推薦