标签:http 使用 sp on 2014 bs ad as size
:nth-child是一个非常牛逼的伪类,如果你能很好的理解它就可以用CSS 做出很多非常实用的效果。当我很年轻的时候还使用PHP的i++来实现一些东西,其实CSS 完全可以实现。下面是我总结的一些用法,用了可爱的糖糖做演示,彩色头像就代表选中,T,T。

li:nth-child(5) {
...
}
如果选择第一个元素的话你可以使用:first-child或者用上面的方法。

li:nth-child(n+6) {
...
}

li:nth-child(-n+5) {
...
}

li:nth-child(4n-7) { /* or 4n+1 */
...
}

li:nth-child(odd) {
...
}

li:nth-child(even) {
...
}

li:last-child {
...
}

-EOF-
标签:http 使用 sp on 2014 bs ad as size
原文地址:http://www.cnblogs.com/sunshq/p/4142296.html