百度360必应搜狗淘宝本站头条
当前位置:网站首页 > 技术文章 > 正文

你想知道的CSS3选择器,全在这里

myzbx 2025-01-17 12:23 19 浏览

CSS3 选择器——基本选择器

1、通配符(*)

<ul class="demo">
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
        <li>5</li>
</ul>
.demo * {border:1px solid blue;}

2、元素选择器(Element)

<ul class="demo">
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
        <li>5</li>
</ul>

li { background-color: grey; color: orange; }

元素选择器,是css选择器中最常见而且最基本的选择器。元素选择器其实就是文档的元素,如html,body,p,div等等,比如这个demo:中元素包括了div,ul,li等。


3、类选择器(.className)

<ul class="demo">
    <li>1</li>
    <li class="li-2">2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
</ul>

.li-2 {font-weight: bold; color: yellow;}

上面代码表示是给有 "li-2" 类名的元素加上一个“字体为粗体,颜色为黄色”的样式。


4、id选择器(#ID)

<ul class="demo">
    <li id="first">1</li>
    <li class="li-2">2</li>
    <li>3</li>
    <li>4</li>
    <li id="last">5</li>
</ul>

#first {background: lime;color: #000;}
#last {background: #000;color: lime;}
上面的代码选择了id为"first"和"last"的li。


5、后代选择器(E F)

<ul class="demo">
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
</ul>

ul li { background-color: red; color: #fff; }

元素的子元素或者是孙元素或者是更深层次的关系,都将被选中,换句话说,不论li在ul中有多少层关系,都将被选中。注意他们之间需要一个空格隔开


6、子元素选择器(E>F)

<ul class="demo">
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
</ul>

ul > li {background: green;color: yellow;}

子元素选择器只能选择某元素的第一层子元素,其中ul为父元素,而li为子元素,其中ul>li所表示的是:选择了ul元素下的所有第一层子元素li。简单的说就是只选择当前第一层级的子元素


7、相邻兄弟元素选择器(E + F)

<ul class="demo">
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
</ul>

li + li {background: green;color: yellow; border: 1px solid #ccc;}

相邻兄弟选择器可以选择紧接在另一个元素后面的元素。

上面的 li+li,其中第二个li是第一个li的相邻元素,第三个又是第二个相邻元素,因此第三个也被选择,依此类推,所以后面4个li都被选中了。


8、通用兄弟选择器(E 〜 F)

<ul class="demo">
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
    <li>6</li>
    <li>7</li>
</ul>

.active ~ li {background: green;color: yellow; border: 1px solid #ccc;}

选择某元素后面的所有兄弟元素(选择相邻的所有兄弟元素),和相邻选择器类似(相邻选择器只选择相邻的一个元素)

选择中了li.active 元素后面的所有兄弟元素li


9、群组选择器

<ul class="demo">
    <li  class="first">1</li>
    <li>2</li>
    <li  class="li-3">3</li>
    <li>4</li>
    <li class="last">5</li>
</ul>

.first,
.last,
.li-3 {background: green;color: yellow; border: 1px solid #ccc;}

群组选择器是将具有相同样式的元素分组在一起,每个选择器之间使用逗号“,”隔开

li.first和li.last和.li-3具有相同的样式效果,所以我们把他们写到一个组里



CSS3 选择器——属性选择器

1、E[attr]:只使用属性名,但没有确定任何属性值

       <ul class="demo">
            <a href="http://www.w3cplus.com" target="_blank" class="links item first" id="first" title="w3cplus">1</a>
            <a href="" class="links active item" title="test website" target="_blank" lang="zh">2</a>
            <a href="sites/file/test.html" class="links item" title="this is a link" lang="zh-cn">3</a>
            <a href="sites/file/test.png" class="links item" target="_balnk" lang="zh-tw">4</a>
            <a href="sites/file/image.jpg" class="links item" title="zh-cn">5</a>
            <a href="mailto:w3cplus@hotmail" class="links item" title="website link" lang="zh">6</a>
            <a href="" class="links item" title="open the website" lang="cn">7</a>
            <a href="" class="links item" title="close the website" lang="en-zh">8</a>
            <a href="" class="links item" title="http://www.sina.com">9</a>
            <a href="" class="links item last" id="last">10</a>
        </ul>
    

.demo a[id] { background: blue; color:yellow; font-weight:bold; }

选择了div.demo下所有带有id属性的a元素,并在这个元素上使用背景色为蓝色,字体加粗并为黄色的样式,


2、E[attr="value"]选择指定的属性对象

        <ul class="demo">
            <a href="http://www.w3cplus.com" target="_blank" class="links item first" id="first" title="w3cplus">1</a>
            <a href="" class="links active item" title="test website" target="_blank" lang="zh">2</a>
            <a href="sites/file/test.html" class="links item" title="this is a link" lang="zh-cn">3</a>
            <a href="sites/file/test.png" class="links item" target="_balnk" lang="zh-tw">4</a>
            <a href="sites/file/image.jpg" class="links item" title="zh-cn">5</a>
            <a href="mailto:w3cplus@hotmail" class="links item" title="website link" lang="zh">6</a>
            <a href="" class="links item" title="open the website" lang="cn">7</a>
            <a href="" class="links item" title="close the website" lang="en-zh">8</a>
            <a href="" class="links item" title="http://www.sina.com">9</a>
            <a href="" class="links item last" id="last">10</a>
        </ul>

.demo a[id="first"] {background: blue; color:yellow; font-weight:bold; }

选择了.demo a[id="first"] 选择属性id的值为first的对象。


3、E[attr~="value"] 包含属性值

        <ul class="demo">
            <a href="http://www.w3cplus.com" target="_blank" class="links item first" id="first" title="w3cplus">1</a>
            <a href="" class="links active item" title="test website" target="_blank" lang="zh">2</a>
            <a href="sites/file/test.html" class="links item" title="this is a link" lang="zh-cn">3</a>
            <a href="sites/file/test.png" class="links item" target="_balnk" lang="zh-tw">4</a>
            <a href="sites/file/image.jpg" class="links item" title="zh-cn">5</a>
            <a href="mailto:w3cplus@hotmail" class="links item" title="website link" lang="zh">6</a>
            <a href="" class="links item" title="open the website" lang="cn">7</a>
            <a href="" class="links item" title="close the website" lang="en-zh">8</a>
            <a href="" class="links item" title="http://www.sina.com">9</a>
            <a href="" class="links item last" id="last">10</a>
        </ul>

.demo a[title~="website"]{ background:orange; color:green; }

div.demo下的a元素的title属性中,只要其属性值中含有"website"这个词就会被选择


4、E[attr^="value"] 选择attr属性值以“value”开头的所有元素

        <ul class="demo">
            <a href="http://www.w3cplus.com" target="_blank" class="links item first" id="first" title="w3cplus">1</a>
            <a href="" class="links active item" title="test website" target="_blank" lang="zh">2</a>
            <a href="sites/file/test.html" class="links item" title="this is a link" lang="zh-cn">3</a>
            <a href="sites/file/test.png" class="links item" target="_balnk" lang="zh-tw">4</a>
            <a href="sites/file/image.jpg" class="links item" title="zh-cn">5</a>
            <a href="mailto:w3cplus@hotmail" class="links item" title="website link" lang="zh">6</a>
            <a href="" class="links item" title="open the website" lang="cn">7</a>
            <a href="" class="links item" title="close the website" lang="en-zh">8</a>
            <a href="" class="links item" title="http://www.sina.com">9</a>
            <a href="" class="links item last" id="last">10</a>
        </ul>

.demo a[href^="http://"]{ background:orange; color:green; }
.demo a[href^="mailto:"]{ background:green; color:orange; }
选择了以href属性并且以"http://"和"mailto:"开头的所有a元素。


5、E[attr$="value"] 选择attr属性值以"value"结尾的所有元素


        <ul class="demo">
            <a href="http://www.w3cplus.com" target="_blank" class="links item first" id="first" title="w3cplus">1</a>
            <a href="" class="links active item" title="test website" target="_blank" lang="zh">2</a>
            <a href="sites/file/test.html" class="links item" title="this is a link" lang="zh-cn">3</a>
            <a href="sites/file/test.png" class="links item" target="_balnk" lang="zh-tw">4</a>
            <a href="sites/file/image.jpg" class="links item" title="zh-cn">5</a>
            <a href="mailto:w3cplus@hotmail" class="links item" title="website link" lang="zh">6</a>
            <a href="" class="links item" title="open the website" lang="cn">7</a>
            <a href="" class="links item" title="close the website" lang="en-zh">8</a>
            <a href="" class="links item" title="http://www.sina.com">9</a>
            <a href="" class="links item last" id="last">10</a>
        </ul>

.demo a[href$="png"]{ background:orange; color:green; }
选择div.demo中元素有href属性,并以png值结尾的a元素。


6、E[attr*="value"] 选择attr属性值中包含子串"value"的所有元素。

        <ul class="demo">
            <a href="http://www.w3cplus.com" target="_blank" class="links item first" id="first" title="w3cplus">1</a>
            <a href="" class="links active item" title="test website" target="_blank" lang="zh">2</a>
            <a href="sites/file/test.html" class="links item" title="this is a link" lang="zh-cn">3</a>
            <a href="sites/file/test.png" class="links item" target="_balnk" lang="zh-tw">4</a>
            <a href="sites/file/image.jpg" class="links item" title="zh-cn">5</a>
            <a href="mailto:w3cplus@hotmail" class="links item" title="website link" lang="zh">6</a>
            <a href="" class="links item" title="open the website" lang="cn">7</a>
            <a href="" class="links item" title="close the website" lang="en-zh">8</a>
            <a href="" class="links item" title="http://www.sina.com">9</a>
            <a href="" class="links item last" id="last">10</a>
        </ul>

.demo a[title*="site"]{ background:black; color:white; }
选择了div.demo中a元素,而a元素的title属性中只要有"site"就选中。


7、E[attr|="value"] 选择attr属性值等于value或以value-开头的所有元素

        <ul class="demo">
            <a href="http://www.w3cplus.com" target="_blank" class="links item first" id="first" title="w3cplus">1</a>
            <a href="" class="links active item" title="test website" target="_blank" lang="zh">2</a>
            <a href="sites/file/test.html" class="links item" title="this is a link" lang="zh-cn">3</a>
            <a href="sites/file/test.png" class="links item" target="_balnk" lang="zh-tw">4</a>
            <a href="sites/file/image.jpg" class="links item" title="zh-cn">5</a>
            <a href="mailto:w3cplus@hotmail" class="links item" title="website link" lang="zh">6</a>
            <a href="" class="links item" title="open the website" lang="cn">7</a>
            <a href="" class="links item" title="close the website" lang="en-zh">8</a>
            <a href="" class="links item" title="http://www.sina.com">9</a>
            <a href="" class="links item last" id="last">10</a>
        </ul>

.demo a[lang|="zh"]{ background: gray; color: yellow; }

选择了div.demo中lang属性等于zh或以zh-开头的所有a元素。


CSS3 选择器——伪类选择器

1、:first-child 选择某个元素的第一个子元素

<ul class="demo">
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
</ul>

.demo li:first-child { background: red; border: 1px solid yellow; color: #fff; }
选择某个元素的第一个子元素。


2、:last-child 选择某个元素的最后一个子元素

<ul class="demo">
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
</ul>

.demo li:last-child { background: red; border: 1px solid yellow; color: #fff; }
选择某个元素的最后一个子元素。


3、:nth-child() 选择某个的一个或多个特定的子元素

  • :nth-child(number);/*参数是具体数字*/
  • :nth-child(n);/*参数是n,n从0开始计算*/
  • :nth-child(n*length)/*n的倍数选择,n从0开始算*/
  • :nth-child(n+length);/*选择大于length后面的元素*/
  • :nth-child(-n+length)/*选择小于length前面的元素*/
  • :nth-child(n*length+1);/*表示隔几选一*/
<ul class="demo">
    <li>1</li>
    <li>2</li>
    <li>3</li>
    <li>4</li>
    <li>5</li>
</ul>

:nth-child() 可以定义括号的值(值可以是整数,也可以是表达式)

.demo li:nth-child(3) { background: red; border: 1px solid yellow; color: #fff; }
选择 div 元素下的第3个 li 子元素。



:nth-child(n) /*参数是n,n从0开始计算*/

.demo li:nth-child(n) { background: red; border: 1px solid yellow; color: #fff; }
等于.demo li {background: lime;}

n是一个简单的表达式,那么"n"取值是从“0”开始计算。

:nth-child(n*length)

.demo li:nth-child(2n) { background: red; border: 1px solid yellow; color: #fff; }
等于.demo li:nth-child(even) {}

选择偶数的对象:n是一个简单的表达式,那么"n"取值是从“0”开始计算。
表达示结果,如下:
.demo li:nth-child(2n) = (2*0) = 0
.demo li:nth-child(2n) = (2*1) = 2
.demo li:nth-child(2n) = (2*2) = 4
.demo li:nth-child(2n) = (2*3) = 6
以此类推....

.demo li:nth-child(2n-1) { background: red; border: 1px solid yellow; color: #fff; }
等于.demo li:nth-child(odd) {}

选择奇数的对象:n是一个简单的表达式,那么"n"取值是从“0”开始计算。
表达示结果,如下:
.demo li:nth-child(2n-1) = (2*0-1) = -1
.demo li:nth-child(2n-1) = (2*1-1) = 1
.demo li:nth-child(2n-1) = (2*2-1) = 3
.demo li:nth-child(2n-1) = (2*3-1) = 5
以此类推....

:nth-child(n+length); /*选择大于length后面的元素*/

nth-child(n+5)从第五个元素开始选择,这里的数字你可以自己定义
.demo li:nth-child(n+5){ background: red; border: 1px solid yellow; color: #fff; }

n是一个简单的表达式,那么"n"取值是从“0”开始计算。

表达示结果,如下:
.demo li:nth-child(0+5) = 5
.demo li:nth-child(1+5) = 6
.demo li:nth-child(2+5) = 7
.demo li:nth-child(3+5) = 8
以此类推....

nth-child(-n+5)反向从第五个元素开始选择,这里的数字你可以自己定义

.demo li:nth-child(-n+5){ background: red; border: 1px solid yellow; color: #fff; }

n是一个简单的表达式,那么"n"取值是从“0”开始计算。

表达示结果,如下:
.demo li:nth-child(-0+5) = 5
.demo li:nth-child(-1+5) = 4
.demo li:nth-child(-2+5) = 3
.demo li:nth-child(-3+5) = 2
以此类推....

:nth-child(n*length+1); /*表示隔几选一*/

:nth-child(4n+1)间隔选择对象,数字可自定义

.demo li:nth-child(4n+1) { background: red; border: 1px solid yellow; color: #fff; }

n是一个简单的表达式,那么"n"取值是从“0”开始计算。

表达示结果,如下:
.demo li:nth-child(4*0+1) = 1
.demo li:nth-child(4*1+1) = 5
.demo li:nth-child(4*2+1) = 9
.demo li:nth-child(4*3+1) = 13
以此类推....


4、:nth-last-child() 选择指定的元素,从最后一个开始

.demo li:nth-last-child(4) { background: red; border: 1px solid yellow; color: #fff; }
选择倒数第四个元素。

可以用表达示,选择奇数

.demo li:nth-last-child(2n) { background: red; border: 1px solid yellow; color: #fff; }

n是一个简单的表达式,那么"n"取值是从“0”开始计算。

表达示结果,如下:
:nth-last-child(2*1) = 2
:nth-last-child(2*2) = 4
:nth-last-child(2*3) = 6
:nth-last-child(2*4) = 8
以此类推....

可以用表达示,选择偶数

.demo li:nth-last-child(2n-1) { background: red; border: 1px solid yellow; color: #fff; }

n是一个简单的表达式,那么"n"取值是从“0”开始计算。

表达示结果,如下:
:nth-last-child(2*1-1) = 1
:nth-last-child(2*2-1) = 3
:nth-last-child(2*3-1) = 5
:nth-last-child(2*4-1) = 7
:nth-last-child(2*5-1) = 9


5、:nth-of-type 选择指定的类型元素

.demo li:nth-of-type(8) { background: red; border: 1px solid yellow; color: #fff; }
指定获取 类型为 li 的第8个元素,中间间隔了a元素

与 :nth-child区别,:nth-child不指定类型 .demo li:nth-child(8) { background: red; border: 1px solid yellow; color: #fff; }

指定获取元素为li第8个元素,中间间隔了a元素,因没有指定类型,而第8个元素是a,所以无法设置样式


6、:nth-last-of-type() 选择指定类型的元素,从元素的最后一个开始计算

.demo li:nth-last-of-type(2) { background: red; border: 1px solid yellow; color: #fff; }

数字可使用n表达式计算,从最后一个元素开始计算,获取指定类型为 li 的第2个元素,


7、:first-of-type 选择指定类型的第一个元素;

.demo li:first-of-type { background: red; border: 1px solid yellow; color: #fff; }

:first-of-type与:first-child类型,前者区别了类型,后者无区域

获取第一个为 li 的元素,子元素中包含了a、li两种元素


8、:last-of-type 选择指定类型的最后一个元素;

.demo li:last-of-type { background: red; border: 1px solid yellow; color: #fff; }

:last-of-type与:last-child类型,前者区分了类型,后者无区分

获取最后一个为 li 的元素,子元素中包含了a、li两种元素


9、:only-child 选择的元素是它的父元素的唯一一个了元素;

        <div>
            <p>我是子级,在父级中是唯一一个子元素。</p>
        </div>

        <div>
            <span>我是span标签,在父级中并不是唯一的子元素,因为还有一个p标签。</span>
            <p>我是p标签,在父级中并不是唯一的子元素,因为还有一个span标签。</p>
        </div>

        <p>
            我是p标签,而我并没有父级。
        </p>

p:only-child { background: #ff0000; }

我是子级,在父级中是唯一一个子元素。
我是span标签,在父级中并不是唯一的子元素,因为还有一个p标签。
我是p标签,在父级中并不是唯一的子元素,因为还有一个span标签。
我是p标签,而我并没有父级。


10、:only-of-type 选择一个元素是它的上级元素的唯一一个相同类型的子元素;

        <div>
            <p>我是子级p元素,在父级中是唯一的一个p元素。所以会被选择中。</p>
            <span>我是子级span元素,在父级中并不是唯一的span元素。</span>
            <span>我是子级span元素,在父级中并不是唯一的span元素。</span>
            <span>我是子级span元素,在父级中并不是唯一的span元素。</span>
        </div>
        <div>
            <p>我是p标签,在父级中并不是唯一的p元素,因为还有一个和我相同的p元素。所以不会被选中。</p>
            <p>我是p标签,在父级中并不是唯一的p元素,因为还有一个和我相同的p元素。所以不会被选中。</p>
        </div>

p:only-of-type { background:#ff0000; }

我是子级p元素,在父级中是唯一的一个p元素。所以会被选择中。

我是子级span元素,在父级中并不是唯一的span元素。 我是子级span元素,在父级中并不是唯一的span元素。 我是子级span元素,在父级中并不是唯一的span元素。

我是p标签,在父级中并不是唯一的p元素,因为还有一个和我相同的p元素。所以不会被选中。
我是p标签,在父级中并不是唯一的p元素,因为还有一个和我相同的p元素。所以不会被选中。


11、:empty 选择的元素里面没有任何内容。

        <p>我是一个p标签,我<span style="color: red;">下面</span>有个p标签,内容是空的,所以它会被选中。</p>
        <p></p>
        <p>我是一个p标签,我<span style="color: red;">上面</span>有个p标签,内容是空的,所以它会被选中。</p>
        <p>我是一个p标签。</p>
        <p>我是一个p标签。</p>

p:empty { background:#ff0000; }

第2行的p标签会被选中,因为它没有内容。

相关推荐

一键生成高颜值图表!让你的文字瞬间有画面感,职场人必备!

哈喽,打工人们!忙碌的周中,大熊又来给你们带来一个超实用的效率神器啦!这次的宝藏网站绝对是那种用过就离不开的"真香"型产品!假设你明天就要做重要汇报,可面对一大堆密密麻麻的文字材料,你...

批量将 Word 转换为 PDF/Excel/Txt/图片等多种格式

Word文档是我们工作中经常会打交道的一种文档格式,我们也经常会有需要对Word文档进行格式转换的需求,比如将Word格式转换为PDF、将Word文档转换为Excel、将Word...

绝了!一键用AI生成高颜值动态PPT(附详细步骤+Prompt)

大家好,我是一名酷爱研究AI的产品经理,最近我有个新发现:那些花了你3天做出来的PPT,现在用AI可以1小时搞定!而且颜值还高!为什么AI做PPT比传统方式效率高10倍?我用一张图就能告诉你:AI生成...

ztext - 简单几行代码创建酷炫3D特效文字的开源JS库

把网页上的文字变成酷炫的3D风格,还能制作旋转动效,有了ztext.js,只需要几行代码。ztext能做什么ztext.js是一个能把常规的平面文字变成3D样式的前端开源代码库,让开发者...

文字内插入小图片,也太可爱了吧(文字中怎么插图片)

图文排版H5手机版秀米有小伙伴留言问添加图片的时候可不可以把图片添加到文字之间比如下面这句话中的小贴纸图片后面可以接着输入文字其实吧这就是咱们的『文字内插入小图片』功能嘛可以用来在文字内加个表情包又...

Linux环境下C++代码性能分析方法(linux怎么写c++代码)

技术背景在开发C++应用程序时,找出代码中运行缓慢的部分是进行性能优化的关键。在Linux系统上,有多种工具和方法可用于对C++代码进行性能分析,每种方法都有其特点和适用场景。实现步骤手动中断调试法在...

SVG互动图文,让你的文章更有趣!教你4种简单易学的黑科技玩法!

如果你是一个公众号创作者,那么你一定想知道如何让你的文章更加吸引人,更加有趣,更加有创意。你可能已经尝试过各种图文排版技巧,但是你是否知道,有一种黑科技可以让你的文章变得更加酷炫,更加互动,更加爆款?...

Videoscribe怎么实现实心中文汉字的手绘制作

很多朋友在制作手绘视频的时候,不知道怎么输入实心的中文汉字,之前我们已经给大家分享了怎么输入汉字的方法,但是有一点遗憾的是输出的汉字是空心的手绘展示,在视觉上并不是非常的美观。经过大家不断的探索,终于...

一款用于将文本转化成图表的现代化脚本语言

大家好,又见面了,我是GitHub精选君!今天要给大家推荐一个GitHub开源项目terrastruct/d2,该项目在GitHub有超过10.3kStar,用一句话介绍该项目就是:...

探秘 Web 水印技术(制作水印网站)

作者:fransli,腾讯PCG前端开发工程师Web水印技术在信息安全和版权保护等领域有着广泛的应用,对防止信息泄露或知识产品被侵犯有重要意义。水印根据可见性可分为可见水印和不可见水印(盲水印)...

不忍心卸载的五款神仙工具(不忍心卸载的五款神仙工具是什么)

001.效率工具uTools-装机必备的生产力工具集uTools是一款非常强大的可以装下几乎所有效率工具的电脑生产力工具集,目前拥有Windows、Mac和Linux三个版本。软件界面...

「SVG」飞花令!这份最高检工作报告“超有料”

原标题:【SVG】飞花令!这份最高检工作报告“超有料”栏目主编:秦红文字编辑:沈佳灵来源:作者:最高人民检察院...

svg|2025政府工作报告,有没有你关心的数据?

··<setattributeName="visibility"begin="click+0s"dur="1ms"fill="freeze"restart="never"to="hi...

videoscribe只能输入英文,如何输入中文文本?

videoscribe只能输入英文,如何输入中文文本?打开VideoScribe软件,打开要添加中文字体的位置。打开Photoshop并在文件中创建一个新的透明背景图层。注意:必须是透明背景层。...

五个流行的SVG在线编辑器(svg编辑工具)

随着响应网络的发展,越来越多的高质量的SVG在线编辑器被公众所熟知。SVG矢量图形也越来越受欢迎,以便在任何设备上呈现图像,甚至一些易于使用的SVG在线编辑器,可以替代PS,本文总结了五种流行的SVG...