结构伪类选择器
1、first-child:选择低一个元素
last-child:选择最后一个元素
nth-child()选择第几个元素
nth-last-
2、:first-of-type[选择第一类元素]/ :last-of-type[选择最后一类元素]/:nth-of-type[第n个元素,或者是奇数odd偶数even][跟:nth-child不同只会计算相同类型的标签: nth-last-of-type[倒着来第n个元素,或者是奇数odd偶数even]
3.E:only-child 只有一个子元素【并且这个子元素E才会操作他的样式】
4.E:only-of-type 这一类子元素只有一个
5、empty:连空格也不允许
6、root:操作的是body
2021-07-27
最新推荐文章于 2025-04-07 22:20:05 发布