css伪类选区子标签元素

小白兔
25个月前

194 0

first-child first-child 表示选择列表中的第一个标签。

last-child last-child 表示选择列表中的最后一个标签

nth-child(3) 表示选择列表中的第 3 个标签

nth-child(2n) )这个表示选择列表中的偶数标签

第n个孩子(2N-1)这个表示选择列表中的奇数标签

第n个孩子(N + 3)这个表示选择列表中的标签从第3个开始到最后。

nth- child(-n+3) 这个表示

选择列表中的倒数第 3 个标签,即小于 3 个的标签。nth-last-child(3) 表示这个选择列表中的倒数第 3 个标签。

使用方法:

li:first-child{}

END

←上一篇

下一篇→没有了