for example given this html
<div class="my_div">a</div>
<div class="my_div">b</div>
<div class="my_div">c</div>
<div>other</div>
how can select last element from class my_div? last-child is not what I need.
That is, given this jquery selector
$(".my_div:last").css({
color: "#090"
});
how can I write the same in pure css ?
This is not possible without modifying your markup. There is no
:last-of-classselector in CSS.