Currently, I am dealing with a ul element list and my goal is to select the first 3 li elements that come after the .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 have tried using the following CSS selector:
ul li.active ~ li:nth-child(n+3)
Unfortunately, this approach did not work as expected. Can anyone provide me with some guidance on how to achieve this?
Additional Note: The .active class dynamically changes, so simply using ul li:nth-child(n+3) will not suffice.