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

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -