传送门:CSS Diner - Where we feast on CSS Selectors!
- plate
- bento
- #fancy
- plate apple
- #fancy pickle
- apple.small
- orange.small
- bento orange.small
- plate , bento
- *
- plate *
- plate + apple
- bento ~ pickle
- plate > apple
- plate orange:first-child
- Plate *:only-child
- #fancy .small , pickle 也可 .small:last-child 较优
- Plate:nth-child(3)
- bento:nth-last-child(3) bento:nth-child(2)也可
- apple:first-of-type
- plate:nth-of-type(2n) 或者直接 plate:nth-of-type(even) 第偶数项
- plate:nth-of-type(2n+3) 注意不是2n+1 因为n是从零开始的 此题要求从第三个开始
- apple:only-of-type
- orange:last-of-type , apple:last-of-type 或者 .small:last-of-type
- bento:empty
- apple:not(.small)
- *[for] 或者省略* 直接[for]
- Plate[for]
- [for="Vitaly"]
- [for^="Sa"] 选择每一个for属性的值以Sa开头的元素
- [for$="ato"] 以ato结尾
- [for*="obb"] 包含子字符串obb
-
P24
end~