我希望我的#club-box 位于顶部,然后是::before 框,然后是#club。我已经通过 z-index 属性尝试过这个。我的代码有什么问题。 http://codepen.io/anon/pen/wBzJBW HTML
<div id="club">
<div class="club-box"> </div>
</div>
CSS
#club {
z-index: -10000;
display: block;
clear: both;
width: 100%;
height: 648px;
background-color: aquamarine;
}
.club-box {
z-index: 1000;
border-radius: 5px;
display: inline-block;
margin: 20px;
width: 300px;
height: 200px;
background: #768;
position: relative;
}
.club-box::before {
z-index: 10;
content: "";
position: absolute;
top: 106px;
left: 17px;
z-index: 100;
width: 263px;
height: 124px;
background-color: black;
}
最佳答案
关于html - css 布局 z-index 属性中的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27638639/