div {
min-height: 500px;
height:auto !important;
height: 500px;
}
之所以可行,是因为(感谢?)IE对待“身高”应该如何对待“最小身高”。
资料来源: 达斯汀·迪亚兹(Dustin Diaz)
备用使用表达式(仅适用于IE)
div {
height: expression( this.scrollHeight < 501 ? "500px" : "auto" );
}
将IE中的最小高度设置为500px。 确保this.scrollHeight <501比所需的最小高度大1 px,否则您会得到一些奇怪的结果。
翻译自: https://css-tricks.com/snippets/css/cross-browser-min-height/