CSS3的nth-child() 和nth-of-type()选择器,表格奇偶行变色
来源:互联网 发布:php程序员如何提高水平 编辑:程序博客网 时间:2024/05/21 20:24
nth-child()选择匹配其父元素,不论其类型。
nth-of-type()选择匹配其 父元素,区分类型。
例如
p:nth-of-type(2){background:#ff0000;}<body><h1>这是标题</h1><p>第一个段落。</p><p>第二个段落。</p><p>第三个段落。</p><p>第四个段落。</p></body>
p:nth-of-type(2)
是第二个段落变成红色p:nth-child(2)
是第一个锻炼变成红色奇偶数匹配
odd代表奇数,even代表偶数
倍数写法
:nth-child(2n+1), :nth-child(2n-3) , :nth-child(4n+3),可以这样写。n为自然数
0 0
- CSS3的nth-child() 和nth-of-type()选择器,表格奇偶行变色
- CSS3选择器:nth-child和:nth-of-type之间的差异(转)
- css3中nth-child选择器和nth-of-type选择器的区别
- CSS3选择器:nth-child和:nth-of-type之间的差异
- CSS3选择器:nth-child和:nth-of-type之间的差异
- CSS3选择器:nth-child和:nth-of-type之间的差异
- CSS3选择器:nth-child和:nth-of-type之间的差异
- CSS3中:nth-child和:nth-of-type的区别
- CSS3中:nth-child和:nth-of-type的区别
- css3 :nth-child和:nth-of-type的区别
- CSS3伪类选择器nth-child和nth-of-type浅析
- CSS3 :nth-child() 与:nth-of-type()
- CSS3—nth-child()和nth-of-type()
- css3之nth-child和nth-of-type
- CSS3:nth-child()伪类选择器,Table表格奇偶数行定义样式
- CSS3的nth-child选择器
- CSS3中:nth-child()和nth-of-type()的却别
- CSS3中:nth-child和:nth-of-type的区别深入理解
- ES6学习笔记(五)--函数与对象
- 团体程序设计天梯赛-练习集 L3-003 社交集群 并查集 解题报告
- eclipse安装subclipse插件在win7中使用报错问题解决方案
- appledoc 使用方法
- SQL Server 2016新特性: Temporal table
- CSS3的nth-child() 和nth-of-type()选择器,表格奇偶行变色
- Java中的函数
- Android梳理 安装工具篇
- ES6学习笔记(六)--set,map数据结构和for...of遍历
- 自定义异常信息
- jacob操作office
- XML、JSON详解
- hadoop相关随记
- 安装RabbitMQ