The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS First- and last-of-type pseudo selectors. Reply To: First- and last-of-type pseudo selectors.


@ Paulie_D… thanks.

My css knowledge is relatively little, and so I’ll learn more about your suggestion… and certainly avoid using ‘nth-of-x’.

Currently, if I’ve understood, I don’t see a way to do what I’d originally hoped to do… confine the style to an element within a specific div (in this case: the last p in ‘div class=”example”), and not have other divs also affected.

UPDATE: I think I may still be misunderstanding this… a simple Codepen test ( suggests desired behavior can be targeted and confined to a specific div.