# css里给多个词语加逗号的一个方法

* 抖音：<https://v.douyin.com/A5YbnBf/>
* B站：<https://www.bilibili.com/video/BV1bM4y127tx/>

> **demo预览：**
>
> <https://sunzsh.github.io/html-demos/multipleTag.html>
>
> **代码：**
>
> <https://github.com/sunzsh/st-html-demo/blob/master/multipleTag.html>

前两天发现一个好玩的问题哈

我这有几个人名

真实情况下他们是循环出来的

（我这只是一个模拟）

然后呢

我想让他们中间啊加上一个顿号

不管有多少个人名

第一个前面没有，就是中间有

后来我发现一个比较好玩的实现方法

就是首先呢我们先给他们呀

肯定都有一个class类

比如我们就叫 item

然后呢我们这块怎么写呢

.item+.item

意味着找到第二个

以及后边的这个span(.item)标签

然后写::before

然后呢写content（其实很简单）

大家看 我这块是逗号把它改成顿号

这样就可以了

这样无论有多少个

他都会自动加上这个顿号


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sunzsh.gitbook.io/xiaoshan.bug/css-li-gei-duo-ge-ci-yu-jia-dou-hao-de-yi-ge-fang-fa.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
