Is dynamic pseudo-class evaluated to the rest of the selector?

As far as I know, CSS selectors get an estimate from right to left, so the body div * will select each element than the appearance, which has a parent div type and those that have a parent body type. I'm not sure if dynamic pseudo-classes are evaluated in this chain.

If I had a selector like div *:hover , how would the evaluation be?

  • :hover => * => div
  • * => :hover => div
  • Another solution that I did not think about
+5
source share
1 answer

Unfortunately,

 * => :hover => div 

First, a universal selector is selected, which means that it looks at every element in the DOM, and then checks to see if it is in the :hover state. Finally, for any matching elements, it then checks the parent div .

-1
source

Source: https://habr.com/ru/post/1215242/


All Articles