li:last-child:nth-child(even)

I actually came across a situation where I legitimately needed to target the last [li] in a list, but only if it was even. This is a screenshot of that use-case.

Example CSS selector...

.item-stream li:last-child:nth-child(even) {
/* Fade zebra-stripe to 0% opacity */
}

Note: This is faux data that we're using just to get a feel for varying character count, line-length, etc. The username "Yabox" and the causes being supported aren't "live."

View all tags
Posted on Oct 31, 2011

More by Nathan Smith

View profile