nth-child,nth-of-type,first-of-type,last-of-type,nth-last-of-type,only-of-type等的区别
*-child和*-of-type分别有五个前缀,即:nth,nth-last,first,last,only。其中nth和nth-last需要传入参数,即第n元素的n值。first前缀等同于nth前缀传入参数1,last前缀等同于nth-last传入参数1。即first-child和nth-child(1)等同,first-of-type和nth-of-type(1)等同,last-
原创
2017-11-14 17:32:00 ·
1834 阅读 ·
0 评论