免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1728 | 回复: 1
打印 上一主题 下一主题

IE 中的最大最小寬度和高度 css 高度 (兼容版本) [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2012-01-04 21:15 |只看该作者 |倒序浏览

IE 中的最大最小寬度和高度 css 高度 (兼容版本)









Html代码
  1. 1./* 最小寬度 */  
  2. 2..min_width{  
  3. 3.    min-width:300px;  /* sets max-width for IE */  
  4. 4.    _width:expression(document.body.clientwidth < 300 ? "300px" : "auto");  
  5. 5.}  
  6. 6.   
  7. 7./* 最大寬度 */  
  8. 8..max_width{  
  9. 9.    max-width:600px;  /* sets max-width for ie */   
  10. 10.    _width:expression(document.body.clientwidth > 600 ? "600px" : "auto");  
  11. 11.}  
  12. 12.   
  13. 13./* 最小高度 */  
  14. 14..min_height{   
  15. 15.    min-height:200px;  /* sets min-height for ie */   
  16. 16.    _height:expression(this.scrollheight < 200 ? "200px" : "auto");  
  17. 17.}  
  18. 18.   
  19. 19./* 最大高度 */  
  20. 20..max_height{   
  21. 21.    max-height:400px;  /* sets max-height for ie */   
  22. 22.    _height:expression(this.scrollheight > 400 ? "400px" : "auto");  
  23. 23.}  
  24. 24.   
  25. 25./* 最大最小寬度 */  
  26. 26..min_and_max_width{   
  27. 27.    min-width:300px;   
  28. 28.    max-width:600px;  /* sets min-width & max-width for ie */   
  29. 29.    _width: expression(document.body.clientwidth < 300 ? "300px":(document.body.clientwidth > 600 ? "600px" : "auto"));  
  30. 30.}  
  31. 31.   
  32. 32./* 最大最小高度 */  
  33. 33..min_and_max_height{   
  34. 34.    min-height:200px;   
  35. 35.    max-height:400px;  /* sets min-height & max-height for ie */   
  36. 36.    _height: expression(this.scrollheight < 200 ? "200px" :( this.scrollheight > 400 ? "400px" : "auto"));  
  37. 37.}  
复制代码

论坛徽章:
0
2 [报告]
发表于 2012-01-04 21:15 |只看该作者
谢谢分享
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP