nth-child()选择器
来源:互联网 发布:php开源社区系统 编辑:程序博客网 时间:2024/06/07 02:25
看官网API解释说该类型的选择器是严格按照CSS样式来的,是从1开始计数
$(document).ready(function(){$('#selected-plays > li').addClass('horizontal');$('#selected-plays li:not(.horizontal)').addClass('sub-level');$('a[href^="mailto:"]').addClass('mailto');$('a[href$=".pdf"]').addClass('pdflink');$('a[href^="http"][href*="henry"]').addClass('henrylink');<!--$('tr:nth-child(odd)').addClass('alt');--><!--$('tr:even').addClass('alt');<!--$('tr:nth-child(3n)').addClass('alt');$('tr:eq(3)').addClass('alt');});
上面的注释的和未注释的区别:
注释第一行:每个table开始下的奇数tr行选择样式‘alt’
注释第二行:所有tr中偶数行选择样式‘alt’
注释第三行:,每个table中的3的倍数行选择样式‘alt’
注释下的一行:所有table中总行中的第三行
- :nth-child选择器
- CSS 选择器nth-child
- CSS3:nth-child() 选择器
- nth-child()选择器
- CSS3 :nth-child() 选择器
- CSS3 :nth-child() 选择器
- CSS3 :nth-child() 选择器
- nth-child选择器
- CSS3 :nth-child() 选择器
- CSS3 :nth-child() 选择器
- nth-child()选择器
- CSS3 :nth-child() 选择器
- jQuery :nth-child() 选择器
- 后代选择器+nth-child()选择器
- jquery 选择器 之 nth-child
- CSS3学习 :nth-child() 选择器
- CSS3的nth-child选择器
- 选择器——:nth-child
- 同一时间范围内并发数统计
- 入门HTML之3.01
- Android类动态加载技术
- OCR磁盘和Votedisk磁盘全部破坏且都没有备份的恢复
- java web开发中 web.xml文件的作用及常用配置说明
- nth-child()选择器
- 一道遇到的面试题: 怎么判断一个随机数生成程序是真随机
- Working Practice-完成工作是员工的第一要素
- 创建新的标注样式并设为当前标注样式
- 卷积
- Oracle RAC Failover 详解
- 小结
- RH436之集群GFS2文件系统
- linux(debian) 下安装ample搭建局域网共享音乐服务器。