Comma-separated list
Here’s a neat little trick that allows you to create a comma-separated list using just an HTML unordered list and a couple of lines of CSS.
ul > li:not(:last-child):after {
content: “, “;
}
In order for this to work you need to make sure to set the display property of the li tag to inline-block.
<ul>
<li>First item</li>
<li>Second item</li>
<li>Third item</li>
</ul>
This is what the result looks like: