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.

jsfiddle of need

use child combinator selector (>) body along @zenith's solution

body > :nth-last-child(2) 

http://jsfiddle.net/fwrw8/2/


Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

ruby - Nesting modules inside of a Rails eninge gem -

Eclipse formatter for java ending braces -