I'm trying to figure out how to manage separators (such as a "-") between each element of a list. It's easy when it's just one line, but I'm having trouble with multiple lines.
On a large screen, my site looks like this:
Example center aligned
<p>
<a>listitem1</a>
<a>listitem2</a>
<a>listitem3</a>
<a>listitem4</a>
<a>listitem5</a>
<a>listitem6</a>
<a>listitem7</a>
...
<a>listitemX</a>
</p>
CSS
a:nth-child(n+2)::before {
content: " - "
}
In CSS, it's simple to add the "-" separator from the second child...
However, with media queries, when the screen gets smaller and the same list spans over multiple lines, I want to remove the last "-" separator from each line.
Example center aligned
Listitem1 - listitem2 - listitem3 - listitem4 (without separator here) Listitem5 - listitem6 - listitem6 - listitem8 (without separator here either) Listitem9 - etc ...
Does anyone have any suggestions? Thank you in advance. Sebastian