html5 - 关于css伪类选择器中:nth-of-type(n) 选择器
PHPz
PHPz 2017-04-17 13:19:55
0
4
1057
PHPz
PHPz

学习是最好的投资!

Antworte allen(4)
刘奇

:nth-of-type(n)只计算父元素中指定的某种类型的子元素
“n”是其参数,而且可以是整数值(1,2,3,4),也可以是表达式(2n+1、-n+5)和关键词(odd、even),但参数n的起始值始终是1,而不是0。也就是说,参数n的值为0时,选择器将选择不到任何匹配的元素。

伊谢尔伦

这位大哥解释的很好,我就不搬了,自己看CSS3选择器:nth-child和:nth-of-type之间的差异

小葫芦

这种问题查MDN最好

https://developer.mozilla.org/zh-CN/docs/Web/CSS/:nth-of-type

刘奇

CSS选择器之:nth-child(n)与:nth-last-of-type(number)

Beliebte Tutorials
Mehr>
Neueste Downloads
Mehr>
Web-Effekte
Quellcode der Website
Website-Materialien
Frontend-Vorlage
Über uns Haftungsausschluss Sitemap
Chinesische PHP-Website:Online-PHP-Schulung für das Gemeinwohl,Helfen Sie PHP-Lernenden, sich schnell weiterzuentwickeln!