jQuery中first(last)、first-child(last-child)、first-of-type(last-of-child)的区别

 first, :first-child, :first-of-type的区别?

:first, 把所有的看成一个集合,集合的第一个,永远只有一个

:first-child, 必须是父元素的第一个子元素

:first-of-type, 本类型的第一个子元素.

last, :last-child, :last-of-type的区别?

同上!

posted @ 2016-08-06 00:09  ShainRou  阅读(83)  评论(0)    收藏  举报