<view class="parentDiv">
<image class="div1" src="{{list[0][4]}}"></image>
<image class="div2" src="{{list[1][4]}}"></image>
</view>
<veiw>我是下面的元素</view>
.parentDiv{
display: flex;
justify-content: center;
align-items: center;
height: 120px; //一定要设置父容器的高度,不然下面的元素会跑上来。
margin-bottom: 50px;
}
.div1{
position: absolute;
width: 120px;
height: 120px;
z-index: 1;
}
.div2{
position: absolute;
width: 120px;
height: 120px;
z-index: 2; /* 提升z-index使其在第一个box之上 */
}