在一个 Float的div中 含两个子层,
有没有方法可以让其中的两个子层 一直重叠?
通过Position:ablosult可以重叠,但其不能包含于其所在的层.

解决方案 »

  1.   

    但其不能包含于其所在的层?
    什么意思啊,重叠是很好做到,设置position就可以了,这个是什么意思?
      

  2.   

    使用
    div.style.left = *
    div.style.top  = *
    div.style.filter = "Alpha(Opacity=0)"
      

  3.   

    主要是前两句后面是我实现的方法,就是用Position:ablosult 来层叠之后, 层叠的两个子层吧,就不能随它的父一起了!
      

  4.   

    to : NekChan(骑蜗牛看星星)
    要让两个子层 虽 其父 动不论滚动条如何动
      

  5.   

    to : NekChan(骑蜗牛看星星)不论滚动条如何动要让两个子层 随 其父层 动
      

  6.   

    给你个演示<!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=gb2312" />
    <title>无标题文档</title>
    <style>
    body
    {margin: 30px; font-size:9pt;}.a, .b, .c, .d, .e
    {
    width: 100px;
    height: 100px;
    margin: 5 auto;
    color: #fff;
    background: #000;
    }
    .aa, .bb, .cc, .dd, .ee
    {
    top: 10px;
    left: 10px;
    width: 10px;
    height: 10px;
    overflow: hidden;
    background: #F90;
    }
    .b, .d, .e
    {position: relative;}
    .cc, .dd, .ee
    {position: absolute;}
    </style>
    </head><body>
    <div class="a">
    <div class="aa"></div>
    A:均不设置postion,一般嵌套关系
    </div><div class="b">
    <div class="bb"></div>
    B:仅外div设置relative,一般嵌套关系
    </div><div class="c">
    <div class="cc"></div>
    C:仅内div设置absolute,文档中为嵌套关系,页面中内div浮起[非float],相对于页面定位,与外div无关。
    </div>
    </body>
    </html>
      

  7.   

    style="z-index: 1000;position: absolute;
    这个可以实现层次而被覆盖的问题
      

  8.   

    首先多谢各位!如图:    +------a------------------------------------+
        |                                           |
        |                                           |
        |                                           |
        |    +----b-----+      +-----c-------+      |
        |    |          |      |             |      |
        | |          |      |             |      |
        |    |          |      |             |      |
        |    |          |      |             |      |
        |    +----------+      +-------------+      |
        |                                           |
        |                                           |
        |                                           |
        +-------------------------------------------+a层包含两个层 b,c ; A的位置是不固定的,有可能用在任何地方,
    ..现在要求的是,b和c能 重叠一起(也则大小和位置完全一致)
    且b,c重叠后的位置相对于A层来说是不变的.