CSS3伪类选择器:nth-child()(nth-child(odd)/nth-child(even))
2016-12-11 21:35
387 查看
nth-child(odd):奇数
nth-child(even):偶数
使用时,如果是精确到数字时,切记是从同一级别的元素开始计算,而不是指定某个类才开始计算。
比如:
<li></li>
<li class="test"></li>
<li></li>
如果我要选择class为test的,nth-child(2),第2个。
详细解释,参考:
http://niutuku.com/tech/css/249737.shtml
nth-child(even):偶数
使用时,如果是精确到数字时,切记是从同一级别的元素开始计算,而不是指定某个类才开始计算。
比如:
<li></li>
<li class="test"></li>
<li></li>
如果我要选择class为test的,nth-child(2),第2个。
详细解释,参考:
http://niutuku.com/tech/css/249737.shtml
相关文章推荐
- CSS3伪类选择器:nth-child()
- CSS3伪类选择器:nth-child()
- CSS3伪类选择器:nth-child()
- CSS3伪类选择器:nth-child()
- CSS3伪类选择器:nth-child()
- CSS3伪类选择器:nth-child()
- CSS3伪类选择器:nth-child(n)及:nth-of-type(n)使用区别探究总结
- CSS3伪类选择器:nth-child()
- web CSS3伪类选择器 :nth-child()
- HTML&CSS——nth-child()选择器
- CSS nth-child、first-child、last-child、nth-of-type、first-of-type和last-of-type选择器使用
- CSS :nth-child与:nth-of-type选择器
- CSS nth-child、first-child、last-child、nth-of-type、first-of-type和last-of-type选择器使用
- nth-child(odd)和nth-child(even)
- CSS伪类选择器nth-child 选择3的倍数个元素写法
- css学习选择器之:nth-child(n)
- CSS 选择器nth-child
- css 伪类选择器 :nth-child(n) 与:nth-of-type(n)的区别
- CSS高级选择器:nth-child()应用大全
- jQuery选择器:nth-child(even) 与:even的区别