CSS Shorthand for all but the last item

  • Targeting a child element is easy: :last-of-type
  • Targeting all but one element is pretty easy, too: :not
  • Chain those together and what do you get? One line of code and less markup in your html!

There are several different approaches to get this: