You are viewing...

CSS Troubleshooting Precedence and Specificity

Updated on September 19, 2021 at the 01th hour
Posted under:

DISCLAIMER: Expressed views on this blog are my own.

CSS Specificity is one thing I cannot claim to understand, but the link below will guide you

https://htmldog.com/guides/css/intermediate/specificity/


I believed that CSS resolved conflicts by where the rule was located rather than in terms of specificity. The idea that "element .child" has higher specificity than element with class ".specific-class" is an odd one to me. I would have thought any classes on the html elements themselves would have highest precedence and override any "element .child" classes.


How many years of CSS have I done and never seen or heard of specificity points being assigned. Well, I just have to accept that I will have to use "!important" at times to do 100% override.

You just read "CSS Troubleshooting Precedence and Specificity". Please share if you liked it!
You can read more recent posts here.