Struggling with creating a Netflix logo using only pure CSS
. I have a span element and its before pseudo-element. The issue is figuring out how to position .netflix span:nth-child(2) in front on the z-axis compared to .netflix span:nth-child(2):before. Is it possible to place elements on the z-axis based on any element we choose, rather than their parent elements? Any help would be appreciated. Here's my HTML
code:
.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>