Does a css selector exist that will target every second .letter?
Of course, I could have put all .letter elements on the same level and used :nth-child(2n), but they all depend on the position of the former letter, so I need the nestedness.
.firstname {
position: relative;
height: 40px;
width: 40px;
margin: 75px 0 0 75px;
border: 1px solid red;
}
.letter {
position: absolute;
font-weight: bold;
display: flex;
justify-content: center;
align-items: center;
height: 40px;
width: 40px;
background: rgba(0,0,255,0.2);
}
.letter > div {
transform: rotate(-40deg);
top: 100%;
}
<div class="firstname">
<div class="letter s">S
<div class="letter e">E
<div class="letter b">B
<div class="letter a">A
<div class="letter s2">S
<div class="letter t">T
<div class="letter i">I
<div class="letter a2">A
<div class="letter n">N</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>