multiple layers
are nested with each other, and then use the p:first-child selector, which cannot be selected correctly. Code:
<body>
111
222
333
</body>
use p:first-child {color:red;}
at this time, only 111turns red, why not all numbers turn red?
I try to change all
to or as far as I understand is it that I misunderstand the pseudo-class that all numbers cannot turn red? , and then switch to the corresponding selector, all the numbers will turn red.
p:first-child
, tags that can be selected must meet two conditions:
: first-child
, or is it a unique reason for