3 ms·
Very cool tip. Do you know if that's an implementation artifact or part of the spec?
by HWR_14 5y ago
Very cool tip. Do you know if that's an implementation artifact or part of the spec?
- csnover 5y agoIt is part of the spec, and is explicitly noted to avoid confusion starting in Selectors Level 3[0]: > Note: Repeated occurrences of the same simple selector are allowed and do increase specificity. [0] https://www.w3.org/TR/selectors-3/#specificity https://www.w3.org/TR/selectors-3/#specificity
- HWR_14 5y agoThanks!
- afiori 5y agoyou can also override id selectors with :is *:is(#a#b, .someclass) {...} overrides any selector with a single id; you add more ids to override more specific selectors (except inline stiles and !important)