CSS :last-child:after

I used the CSS :last-child and :after selectors to hack the content: property on my menu lists. Basically items in the menu have a pipe ‘|’ between them, except no pipe before or after the list. I did that in CSS with:

#menu li:after {
  content: ' | ';
}
#menu li:last-child:after {
  content: '';
}

Leave a Reply