2011-12-28 16:39 设置最小高度和最大高度等

min-height:400px;*+height:100%;_height:400px;

 

1、IE6支持max-height解决方法

IE6 支持最大高度解决CSS代码:.yangshi{max- height:1000px;_height:expression((document.documentElement.clientHeight||document.body.clientHeight)<1000?"1000px":"");overflow:hidden;}

说 明:max-height:1000px; 这个是IE6以上级其它品牌浏览器支持最大范围高度。而 _height:expression((document.documentElement.clientHeight||document.body.clientHeight)<1000?"1000px":"");

overflow:hidden;则是让IE6支持max-height替代CSS代码,但效果和其它版本浏览器相同效果。

让 所有浏览器都支持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;

2、IE6支持min-height解决方法

IE6支持最小高度解决CSS代 码:.yangshi{min- height:1000px;_height:expression((document.documentElement.clientHeight||document.body.clientHeight)>1000?"1000px":"");}

说 明:min-height:1000px; 这个是IE6以上级其它品牌浏览器支持最小范围高度。而 _height:expression((document.documentElement.clientHeight||document.body.clientHeight)>1000?"1000px":""); 则是让IE6支持min-height替代CSS代码,但效果和其它版本浏览器相同效果。

让所有浏览器都支持min-height的CSS 样式代码,完整:min- height:1000px;_height:expression((document.documentElement.clientHeight||document.body.clientHeight)>1000?"1000px":""); 这里的1000和1000px是你需要的数值,注意3个数值的相同。

3、IE6支持max-height又支持min-height方法 让所有浏览器包括IE6即支持最大高度又支持最小高度。

.yangshi{Max-Height:620px;Min-Height:40px;_height:expression(this.scrollHeight > 620 ? "620px" : (this.scrollHeight < 40 ? "40px" : "auto"));}

IE6 支持Max-Height和支持Min-Height CSS代码_height:expression(this.scrollHeight > 620 ? "620px" : (this.scrollHeight < 40 ? "40px" : "auto"));

posted @ 2012-08-27 10:08  坏混混  阅读(141)  评论(0编辑  收藏  举报