JSFiddle - React, Tailwind, and code Playground

HTML

<div id="test">
<ul>
<li><button>1</button></li>
<li><button>2</button></li>
<li><button>3</button></li>
<li><button>4</button></li>
<li><button>5</button></li>
<li><button>6</button></li>
    </ul>
</div>

CSS

#test button
{
    background-color: blue;
}

#test ul li:nth-child(-n + 3) button
{
    background-color: red;
}

#test button:hover {
    background-color: green !important;
}