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大小

  • 相关阅读:
    oracle 查看运行中sql
    orcale 匿名代码块
    vsftpd 自动安装脚本
    js 第二篇 (DOM 操作)
    js 第一篇(常用交互方法)
    安装部署Solrcloud
    安装部署zookeeper集群
    zabbix-agent active 配置自动探测
    zabbix 3.2.4 安装
    python os模块 常用函数
  • 原文地址:https://www.cnblogs.com/tinyphp/p/2878043.html
Copyright © 2011-2022 走看看