I'm making a Netflix logo with pure CSS
and I'm stuck. I create span element and also before the element of span 2. However, I don't know how to place .netflix span:nth-child(2) front on the z-axis when it is compared by .netflix span:nth-child(2):before. Basically, my question is is there any way to place elements on z-axis according to not by their parent elements but any elements that we want. Thanks in advance my HTML
file is the following.
.netflix span {
width: 50px;
height: 100%;
display: inline-block;
position: absolute;
background: #e50914;
margin: 0;
padding: 0;
top: 0;
transform-origin: top left;
}
.netflix span:nth-child(1) {
left: 0;
}
.netflix span:nth-child(2) {
transform: skewX(26deg);
box-shadow: 0 0 20px 13px rgba(0, 0, 0, 0.6);
}
.netflix span:nth-child(2):before {
content: '';
position: absolute;
width: 100%;
height: 100%;
background: inherit;
transform-origin: bottom right;
transform: skewX(-25deg);
}
<div class="center netflix">
<span></span>
<span></span>
<h1>NETFLIX</h1>
</div>