CSS Max Height Property
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there a good cross-browser way to set a max-height property of a DIV and when that DIV goes beyond the max-height, it turns into an overflow with scroll bars? 回答1: Sadly IE6 doesn't so you have to use an expression for IE6, then set the max-height for all other browsers: div{ _height: expression( this.scrollHeight > 332 ? "333px" : "auto" ); /* sets max-height for IE6 */ max-height: 333px; /* sets max-height value for all standards-compliant browsers */ overflow:scroll; } Overflow:auto would most likely work in most cases for have any