How can I select the element prior to a last child?

You can use :nth-last-child(); in fact, besides :nth-last-of-type() I don’t know what else you could use. I’m not sure what you mean by “dynamic”, but if you mean whether the style applies to the new second last child when more children are added to the list, yes it will. Interactive fiddle.

ul li:nth-last-child(2)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)