廢話少說枫匾!
最小高度:
.your-class {
min-height: 1000px;
height: auto !important;
height: 1000px;
}
最小寬度:
.your-class {
min-width: 1000px;
width: auto !important;
width: 1000px;
}
重點:
先利用較新的瀏覽器識別min-width/height,透過它來指定值,而IE6則是透過width/height取值嘴办。 不過這里有個沖突漾稀,就是新的瀏覽器也識別width/height派近,因此min-width/height會被width/height改寫,解決的辦法,就是中間那一行媚朦。 height: auto !important;(以及width: auto !important;) 由于它標示!important氧敢,所以下面那行height無法取代上面這一行,見解變成新的瀏覽器忽視掉第三行询张,而讓高度不受第三行影響孙乖。 另外由于IE6不識別 min-height和 !important屬性,所以它還是取第三行的語法份氧,這樣就可以相安無事的圆,皆大歡喜。