欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

CSS控制div寬度最大寬度/高度和最小寬度/高度的方法

  發(fā)布時間:2016-10-12 10:15:04   作者:佚名   我要評論
下面小編就為大家?guī)硪黄狢SS控制div寬度最大寬度/高度和最小寬度/高度的方法。小編覺得挺不錯的,現(xiàn)在就分享給大家,也給大家做個參考。一起跟隨小編過來看看吧

在網(wǎng)頁制作中經(jīng)常要控制div寬度最大寬度/高度或者最小寬度/高度,但是在IE6中很多朋友都會遇到不兼容的頭疼問題,包括我也經(jīng)常遇到這樣的問題,在百度查了很多都沒法解決,后來在一個論壇上學習到,在這里跟大家分享下css3樣式代碼,經(jīng)過時間完全兼容各大主流瀏覽器。

CSS Code復制內(nèi)容到剪貼板
  1. * 最小寬度 */   
  2. .min_width{min-width:300px;   
  3.    /* sets max-width for IE */  
  4.    _width:expression(document.body.clientWidth < 300 ? "300px" : "auto");   
  5. }   
  6.   
  7. /* 最大寬度 */  
  8. .max_width{   
  9.    max-width:600px;   
  10.    /* sets max-width for IE */  
  11.    _width:expression(document.body.clientWidth > 600 ? "600px" : "auto");   
  12. }   
  13.   
  14. /* 最小高度 */  
  15. .min_height{   
  16.    min-height:200px;   
  17.    /* sets min-height for IE */  
  18.    _height:expression(this.scrollHeight < 200 ? "200px" : "auto");   
  19. }   
  20.   
  21. /* 最大高度 */  
  22. .max_height{   
  23.    max-height:400px;   
  24.    /* sets max-height for IE */  
  25.    _height:expression(this.scrollHeight > 400 ? "400px" : "auto");   
  26. }   
  27.   
  28. /* 最大最小寬度 */  
  29. .min_and_max_width{   
  30.    min-width:300px;   
  31.    max-width:600px;   
  32.    /* sets min-width & max-width for IE */  
  33.    _width: expression(   
  34.       document.body.clientWidth < 300 ? "300px" :   
  35.         ( document.body.clientWidth > 600 ? "600px" : "auto")   
  36.    );   
  37. }   
  38.   
  39. /* 最大最小高度 */  
  40. .min_and_max_height{   
  41.    min-height:200px;   
  42.    max-height:400px;   
  43.    /* sets min-height & max-height for IE */  
  44.    _height: expression(   
  45.       this.scrollHeight < 200 ? "200px" :   
  46.         ( this.scrollHeight > 400 ? "400px" : "auto")   
  47.    );   
  48. }  

以上就是小編為大家?guī)淼腃SS控制div寬度最大寬度/高度和最小寬度/高度的方法全部內(nèi)容了,希望大家多多支持腳本之家~

相關文章

最新評論