HTML: <div id="aa"> <div id="bb"> <div id="dd"></div></div> <div id="cc"></div> </div> CSS: #aa{ position: absolute; width: 100px; height: 100px; background-color: #ddd; z-index: 1; } #bb{ position: absolute; width: 80px; height: 100px; background-color: #000; z-index: 2; } #cc{ position: absolute; width: 70px; height: 10px; bottom:0; background-color: red; z-index: 2; } #dd{ position: absolute; width: 60px; height: 2000px; background-color: yellow; z-index: 17; }
总之, 层叠上下文是拼爹的, 而且老爹爱幼子.
一周热门 更多>