How to use css to select the last element?

Guys, could you please answer the following question. In this case, using only css to select the last element highlights. Elements with the class highlights can be any number.
the <div>
 <section class="day"></section>
 <section class="day"></section>
 <section class="highlights"></section>
 <section class="highlights"></section>
 <section class="highlights"></section>
 <section class="day"></section>
</div>
March 19th 20 at 08:39
2 answers
March 19th 20 at 08:41
Just the last section can be selected using :last-child


Latest with the specified class only scripts or changing the layout.
Well, or to explicitly write out the number of the element in css.
In this case, using only css to select the last element highlights
- gay.Witting5 commented on March 19th 20 at 08:44
March 19th 20 at 08:43
If I'm not mistaken you can not, if you need it for a class highlights
But with jquery no problem

$("div .highlights").last().addClass("selected");

Find more questions by tags CSS