.box{ max-height:140px; _height:expression(this.scrollHeight > 140 ? "140px" : "auto"); overflow:auto; }
再将其扩展之,则:
.box{ max-height:140px; min-height:40px; _height:expression(this.scrollHeight > 140 ? "140px" : (this.scrollHeight < 40 ? "40px" : "auto")); overflow:auto; }
这样就简单实现了在IE6下兼容min-height及max-height的效果,同样,min-width及max-width也可用此法。