zoukankan      html  css  js  c++  java
  • 解决在IE6、7中用height来设定SELECT标签高度无效的兼容性问题

    在IE6、7中用height来设定SELECT标签高度是无效的,宽度的话各浏览器设置都是一致的,解决方法就是在select外嵌套两层标签,一层用来遮挡select的默认边框(在IE6、7中设置border:0px也是无效的),另一层用来模拟”高度改变后的“select边框.
    代码如下
    html代码
    <div class="standard_select">
        <!--边框-->
        <div class="select_shelter">
            <!--遮挡默认边框-->
            <select>
                <option selected="selected">水果</option>
                <option>苹果</option>
                <option>橘子</option>
                <option>葡萄</option>
                <option>桃子</option>
            </select>
        </div>
    </div>

    css代码

     .standard_select{ /*边框*/
                display:inline-block;
                *display:inline;
                zoom:1;
                border:solid 1px black;
                padding:5px; /*调整此处改变select高度*/
                *padding:7px;
            }
            .select_shelter{ /*遮挡默认边框*/
                display:inline-block;
                *display:inline;
                zoom:1;
                width:100px;
                *width:98px;
                height:20px;
                overflow:hidden;
            }
            select{
                *margin:-1px;
                padding:3px;
                border:0px;/*遮挡现代浏览器的select边框*/
                width:100px;
            }
  • 相关阅读:
    Codeforces 878A
    Codeforces 873B-Balanced Substring
    codeforces 868C
    51nod 1402 最大值(贪心)
    最小正子段和 贪心
    codeforces 819B
    Codeforces 785D
    Codeforces 864E
    863D
    UVA 1380 A Scheduling Problem
  • 原文地址:https://www.cnblogs.com/sapho/p/4966285.html
Copyright © 2011-2022 走看看