Comma-Separated Lists

Make list items look like a real, comma-separated list:

  1. ul > li:not(:last-child)::after {
  2. content: ",";
  3. }

Use the :not() pseudo-class and no comma will be added to the last item.

Note: This tip may not be ideal for accessibility, specifically screen readers. And copy/paste from the browser doesn’t work with CSS-generated content. Proceed with caution.