| 名称 | Css | jQuery |
| 第一个元素 | :first-child | :first, :first-child |
| 最后个元素 | :last-child | :last, :last-child |
| 偶数的元素 | :nth-child(even) | :even |
| 奇数的元素 | :nth-child(odd) | :odd |
| 大于给定索引值的元素 | :nth-child(n+2) | :gt(0) |
| 小于给定索引值的元素 | :nth-child(-1n+8) | :lt(2) |
CSS3 :nth-child()伪类选择器
http://www.cnblogs.com/kiracn/archive/2009/12/17/1626742.html

本文对比了CSS与jQuery中的选择器用法,包括:first-child、:last-child等,并介绍了nth-child()伪类的选择器使用方法。
725

被折叠的 条评论
为什么被折叠?



