I'm trying to use :nth-of-type to highlight a specifc element beased on its class and index.
.verse {
display: block;
margin-top: 2em;
margin-bottom: 2em;
}
.line {
display: block;
}
.word {
display: inline;
}
.beat {
display: inline;
}
.verse .line .beat:nth-of-type(3) {
border-width: 1px;
border-color: yellow;
border-style: solid;
}
<div class="song">
<div class="verse">
<div class="line">
<div class="word">
<div class="beat">His</div>
<div class="beat">t'ry</div>
</div>
<div class="word">
<div class="beat">for</div>
</div>
<div class="word">
<div class="beat">10's</div>
</div>
<div class="word">
<div class="beat">ans</div>
<div class="beat">wer</div>
</div>
<div class="word">
<div class="beat">is</div>
</div>
</div>
</div>
</div>
Here is a fiddle:
https://jsfiddle.net/MarkNahabedian/0ya5ugow/
Due to vision limitations, I use dark theme.
I don't see the specified border around the word "for".
When I look using developer mode in Chrome (in my real example, not the fiddle), I see that the border style is shown in the styles pane, but not in the actual display of the document.
Can someone tell me what I'm missing or doing wrong?
Thanks.