我不明白为什么pseudo元素:: after不会在蓝框后面,当我把z-index作为负值与其他div没有z-index值。就在蓝色框在黄色框后面的那一刻,但我希望黄色框在蓝色框下方,但在红色框上方。负z指数不工作::在伪元素后
.menu1{
height: 100px;
width: 100px;
background-color: red;
}
.menu1 .menupicture1{
width: 50px;
height: 50px;
position: relative;
top: 90px;
background-color: blue;
}
.menu1 .menupicture1::after{
content: "";
display: block;
height: 75px;
width: 75px;
background-color: yellow;
z-index: -1;
}
<div class="menu1">
<div class="menupicture1"></div>
</div>