css - Get (N-1)th last item on the page -
i have number of elements specific css class on page (let's item
). possible apply css style on (n-1)th .item
? example there 9 elements need style 8th.
i know :nth-last-child(2)
. doesn't work in case. searches child elements in case elments distributed between different parents.
use child combinator selector (>
) body
along @zenith's solution
body > :nth-last-child(2)
Comments
Post a Comment