Home › Forums › CSS › First- and last-of-type pseudo selectors. › Reply To: First- and last-of-type pseudo selectors.
July 27, 2017 at 1:34 pm
#257131
bearhead
Participant
In your example, you’re not applying the last-of-type selector to a specific class, instead you are applying it to last child p element of a given div with a specific class.
BUT
You should be able to accomplish what you are after… in fact you have the correct css for such in your demo. div.test2 p:last-of-type
.
Just note that the last of type selector is being applied to the p element and not the div.