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

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."

  • 1,272 views
  • Icon shotstat like
  • Icon shotstat drop

More from Nathan Smith

  1. Handlebbbars
  2. Unsemantic
  3. Menu Arrow Hover
  4. Data Table

Tags

keyboard shortcuts: L or F like post comment