zoukankan      html  css  js  c++  java
  • 兼容ie6:zindex

    在IE下缺省值为0;

    同级关系,大的在上;

    非同级关系或非父子关系元素,须比较其为兄弟关系的两个祖先元素的z-index,

    原则是:值大的元素所有的后代元素,均超过值小的元素及其后代元素。

     

    例子:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>ie6兼容:z-index</title>
    </head>
    <style>
    div{ width:100px; height:100px;}
    .father1{ background:#FF6633; position:relative; z-index:1;}
    .father1-child{ position:absolute; top:10px; left:10px; background:#0000FF; color:#fff; z-index:999;}
    .father2{ background:yellow; z-index:5;position:relative;}
    </style>
    <body>
    <div class="father1">
    <div class="father1-child">father1-child</div>
    </div>
    <div class="father2">father2</div>
    </body>
    </html>

    想父1层的子层越过父2层,则调整他们的z-index大小

  • 相关阅读:
    redis中文API
    基于redis的分布式锁
    redis安装使用配置
    windows常用命令
    curl命令详解
    linux远程连接
    memcache在大型网站的应用策略
    缓存使用的一些注意事项
    记录memcache分布式策略及算法
    U盘安装Centos7.0图解
  • 原文地址:https://www.cnblogs.com/tinyphp/p/2878043.html
Copyright © 2011-2022 走看看