Style the last element having a specific class [closed]

I have a code like this.

<div class="slick"></div>
<div class="slick active"></div>
<div class="slick active"></div>
<div class="slick active"></div>
<div class="slick"></div>
<div class="slick"></div>

I want to style the last div having the class ‘active’. Is there any way to do this?

2 Answers
2

There is no (good) way to solve this problem in its current state with CSS. The best solution is to add an extra class to the last active div, or to use javascript

See this question for more details

Leave a Comment