DEV Community

Discussion on: CSS the :not() selector

Collapse
 
alohci profile image
Nicholas Stimpson

You should clarify the point about specificity. :not() is unusual compared to traditional pseudo-classes in having no specificity of its own, using that of its parameter instead. So #foo:not(#bar) has a specificity of 0,2,0,0 rather than 0,1,1,0. The newer :is() and :where() pseudo-classes similarly have specialised specificity rules.