JSFiddle - React, Tailwind, and code Playground

HTML

<div>
    OK:
<a>x</a><a>x</a><a>x</a><a>x</a><a>x</a><a>x</a>
</div>
<div>Not OK:
    <a>y</a>
</div>

CSS

a:nth-child(n+3):last-child {
    color:red;
}