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)属性。

  • 相关阅读:
    OSCache报错error while trying to flush writer
    html 输入框验证
    Struts2 一张图片引发的bug
    Html 小插件10 即时新闻
    String
    内部类
    多态
    抽象&接口
    继承
    封装
  • 原文地址:https://www.cnblogs.com/simpledev/p/3525887.html
Copyright © 2011-2022 走看看