Specificity of inherited CSS properties
Any declaration that matches element directly will get priority over the property that’s inherited from the element’s parent. Specificity has nothing to do with that.
Any declaration that matches element directly will get priority over the property that’s inherited from the element’s parent. Specificity has nothing to do with that.
Yes, I’d say your example of using !important is bad practice, and it’s very likely it would cause undesired effects further down the line. That doesn’t mean it’s never okay to use though. What’s wrong with !important: Specificity is one of the main forces at work when the browser decides how CSS affects the page. … Read more
Pekka’s answer is practically correct, and probably the best way to think about the issue. However, as many have already pointed out, the W3C CSS recommendation states that “Concatenating the three numbers a-b-c (in a number system with a large base) gives the specificity.” So the geek in me just had to figure out just … Read more