让所有浏览器都支持max-height的CSS样式代码,完整:
max-height:1000px;_height:expression((document.documentElement.clientHeight||document.body.clientHeight)<1000?"1000px":""); overflow:hidden;这里的1000和1000px是你需要的数值,注意3个数值的相同。
让IE6支持最大高度max-height的时候别忘记加上overflow:hidden;
min-height,同理!
max-height:1000px;_height:expression((document.documentElement.clientHeight||document.body.clientHeight)<1000?"1000px":""); overflow:hidden;这里的1000和1000px是你需要的数值,注意3个数值的相同。
让IE6支持最大高度max-height的时候别忘记加上overflow:hidden;
min-height,同理!
本文提供了一种方法,通过使用JavaScript表达式来确保所有浏览器,包括IE6,都能正确应用max-height CSS样式,同时保持页面布局的整洁。通过设置max-height、min-height和overflow属性,可以实现不同浏览器的一致性效果。
1万+

被折叠的 条评论
为什么被折叠?



