For selecting the first and second children, you can use a single :nth-child() pseudo-class like so: ul li:nth-child(-n+2) a { background: ... ... <看更多>
Search
Search
For selecting the first and second children, you can use a single :nth-child() pseudo-class like so: ul li:nth-child(-n+2) a { background: ... ... <看更多>
If you count your own children you would say "my first child", "my second child" and so on, not "my zeroth child". This is simply how humans ... ... <看更多>
The index of the first child of an element is 1. In addition to this, :nth-child() can take ' odd ' and ' even ' as arguments instead. ... <看更多>
:nth-last-child is still reliable when prepending the style element and should not be listed. Consumers not interested in SSR should be able to ... ... <看更多>