After attempting to search on Google, I am struggling to find the right keywords.
I'm trying to apply a pseudo-selector only to a specific class.
In this scenario, if we remove the specified class, the last Hi
should appear in blue. However, my expected outcome is not being achieved. Should I adjust my approach or am I expecting too much from CSS?
span.dinosaur:last-child {
color: blue;
}
<body>
<span class='dinosaur'>Hi</span>
<span class='dinosaur'>Hi</span>
<span>Hi</span>
<span>Hi</span>
</body>