答案 0 :(得分:0)
相对于上述div的绝对位置。您可以将红色div设为绝对值并将其显示在黄色div后面
<div style="width:40px;height:100px;">
<div id="relative">
<div class="absolute">yellow</div>
<div style="position:absolute; top: 130px; background: #f00; height: 80px;">red</div>
</div>
</div>
#relative {
position: relative;
}
.absolute {
position: absolute;
top: 0;
left: 0;
z-index: 12;
width: 200px;
height: 150px;
background: yellow;
}