occasionally see a statement:
s1:hover ~ s2{color:red;}
it is found that "~" can make the selector achieve the effect of "if", that is, if the previous condition is met, the selector of S2 will be started.
but google didn"t find the tutorial materials for a long time. W3c/mdn checked it. I really don"t know the name of this knowledge point, and I can"t look up
. I hope the gods will give some guidance.
_
first of all, thank you for your advice ~
the reason has been found, but the reason is dynamic pseudo-class
+ sibling selector
, all the knowledge points have been learned, but there has been no actual combat. When I looked at the original code of an example yesterday, I suddenly froze. I thought that ~
was a new symbol of HTML5, drilling into a dead end for a long time.
it seems that just reading books and doing exercises can not be integrated. There is no creativity and integration in the brain. If you encounter practical problems, you will get stuck, and you will really collapse.
Thank you again for your help