IE6支持兼容max-height、min-height CSS样式
2015-06-04 14:26
736 查看
1、IE6支持max-height解决方法 - TOP
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解决方法 - TOP
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支持css 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方法 - TOP
让所有浏览器包括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"));
说明:以上代码作用是让对象的最小高度为40px,最大高度为620px的CSS样式属性
相关文章推荐
- 【CSS3】---样式小技巧
- 【CSS3】---盒模型margin、padding及border
- 【CSS3】---曲线阴影翘边阴影
- 【CSS3】---层模型position之fixed固定定位、absolute绝对定位和relative相对定位
- 【CSS3】---@font-face
- 【CSS3】---元素隐藏(是否占据空间、是否可点击)
- 【CSS3】---:before :after生成内容
- 编写灵活、稳定、高质量的 HTML 和 CSS 代码的规范
- 【CSS3】---块状元素、内联元素(又叫行内元素)和内联块状元素
- 【CSS3】---only-child选择器+only-of-type选择器
- 【CSS3】---last-of-type选择器+nth-last-of-type(n)选择器
- 【CSS3】---first-of-type选择器+nth-of-type(n)选择器
- 【CSS3】---结构性伪类选择器-first-child+last-child
- 【CSS3】---结构性伪类选择器-root+not+empty+target
- 【CSS3】---属性选择器
- 【CSS3】---练习制作导航菜单
- 【CSS3】---background-origin background-clip background-size
- 【CSS3】---文本阴影text-shadow
- 【CSS3】---嵌入字体@font-face
- 【CSS3】---text-overflow 与 word-wrap