• IE6 最大(小)高宽


    -、最大宽/高

    IE6无法认读max-width,max-height属性,但IE支持自己javascript的属性表达,
    例如
    div{expression(250+"px")}和div{widt:250px}

    在IE 的认读中都是一致的!

    但是,如果在用户在浏览器禁用javascript,那么我们的写法就失败了。
    所以,我们换种方式写,解决上面出现的失败现象。

    * html div#division
    expression( document.body.clientWidth > 776 ? "777px" : "auto" );
    /* sets max-width for IE  为IE设置最宽值*/

    max- 777px;/* this sets the max-width value for all standards-compliant browsers */
    }

    * html div#division {
       expression( document.body.clientWidth > (500/12) * parseInt(document.body.currentStyle.fontSize) ? "33em" : "auto" );
       max- 33em;
    /* this sets the max-width value for all standards-compliant browsers */
    }

     最小宽高可以用类似的方式实现,如下:

    * html div#division {
       expression( document.body.clientWidth < 334 ? "333px" : "auto" );
    /* set min-width for IE 为IE设置宽度最小值*/
       min- 333px;
    /* sets min-width value for all standards-compliant browsers */
    }

    * html div#division {
       height: expression( this.scrollHeight > 332 ? "333px" : "auto" );
    * sets max-height for IE 为IE设置高度最大值*/
       max-height: 333px;
    /* sets max-height value for all standards-compliant browsers */
    }

    * html div#division {
       height: expression( this.scrollHeight < 334 ? "333px" : "auto" );
    /* sets min-height for IE 为IE设置高度最小值*/
       min-height: 333px;
    /* sets min-height value for all standards-compliant browsers */
    }

    二、最小宽/高虽然可以用上面的方法实现,但有更简单的方式

    div#division {

      min-300px;

      auto!important;

      300px;

    }

    注意顺序不能更改

    高否?富否?帅否? 否? 滚去学习!
  • 相关阅读:
    <Android 应用 之路> 天气预报(五)
    Java图形界面开发—列出指定目录
    解决The Network Adapter could not establish the connection
    <Android 应用 之路> 天气预报(四)
    Java集合框架—List
    Java集合框架—Map
    C#工程缺少IIS组件无法打开的解决办法
    关于com工程依赖的一些总结
    C:移位运算符
    void类型及void指针
  • 原文地址:https://www.cnblogs.com/baixc/p/4234865.html
Copyright © 2020-2023  润新知