So, I have a ul element list and I want to select the first 3 li elements after .active class
<ul>
<li>The #1</li>
<li>The #2</li>
<li class="active">The #3</li>
<li>The #4</li>
<li>The #5</li>
</ul>
I was thinking something like this:
ul li.active ~ li:nth-child(n+3)
But it does not work. Anyone can help me out with this?
P.S.: Class .active is dynamically changing, so any ul li:nth-child(n+3) will not help.