zoukankan      html  css  js  c++  java
  • javascript div z-index, input tabindex属性说明

    <html>
    
    <body>
        <form>
             用户名: <input type="text" tabindex="1" />
             密码: <input type="text" tabindex="2" />
             地址: <input type="text" tabindex="3" />
             性别: <input type="text" tabindex="4" />
             年龄: <input type="text" tabindex="5" />
        </form>
        
    
        <div style="position: absolute;500;height:500;background-color:red; z-index:0">  <!-- 不要写成z-index=2 -->"
        第一层
        </div>
        
        <div style="position: absolute;600;height:400;background-color:green; z-index:-2">
        第二层
        </div>
            
        <div style="position: absolute;300;height:300;background-color:blue; z-index:5">
        第三层
        </div>
                        
    </body>
    </html>

    tabindex定义了按tab键获取光标的先后顺序~!
    z-index定义了层的层次关系,在层之上还是在层之下.值大的在上面。重要说明:在某些情况下设置z-index没有效果,原因是需要设置position:absolute;为绝对定位才可以。

    这种情况发生的条件有三个:(div层调整zindex属性在IE中无效原因分析及解决方法)

    1、父标签 position属性为relative;

    2、问题标签无position属性(不包括static);

    3、问题标签含有浮动(float)属性。

  • 相关阅读:
    157 判断字符串是否没有重复字符
    53 翻转字符串
    671 循环单词
    8 旋转字符串
    39 恢复旋转字符串
    6 合并排序数组 Ⅱ
    64 合并排序数组
    60 搜索插入位置
    141 x的平方根
    TCSRM 593 div2(1000)(dp)
  • 原文地址:https://www.cnblogs.com/simpledev/p/3525887.html
Copyright © 2011-2022 走看看