3 ms·
Right—you can do the same thing with ID selectors, they just always have a higher specificity because they are in bucket A[0], whereas virtually all the other s
by csnover 5y ago
Right—you can do the same thing with ID selectors, they just always have a higher specificity because they are in bucket A[0], whereas virtually all the other selectors are in bucket B.
If you really have to select that element by ID for some reason, you can use an attribute selector instead—`[id=foo]`—and then it’s also in bucket B and can be controlled in the normal way.
Basically, you should consider ID selectors (and element selectors) an antipattern and never use them.
[0] https://www.w3.org/TR/selectors-4/#specificity-rules https://www.w3.org/TR/selectors-4/#specificity-rules