How to style unordered lists in CSS as comma separated text

后端 未结 6 2049
时光说笑
时光说笑 2020-12-08 06:10

I’m looking for a way to style an unordered list in XHTML with CSS such that it is rendered inline and the list items are separated by commas.

For example, the follo

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-08 06:50

    It's easy with CSS3 you can use pseudo selector last-child and not at once:

    ul#taglist li:not(:last-child):after {
        content: ", ";
    }
    

    Check results here https://jsfiddle.net/vpd4bnq1/

提交回复
热议问题