see:
the div is relative with z-index 5, and the :after thing is absolute with z-index 2.
So shouldn't :after be behind the div?
div{
position:relative;
z-index: 5;
background: #000;
padding: 10px;
}
div:after{
content: '';
position: absolute;
z-index: 2; /* <= not working:( */
background: #3d3;
left: 20px;
top: 20px;
width: 30px;
height: 30px;
}
<div>erferf</div>