CSS Specificity
Depending where CSS rules are defined they can have different consequences on your pages.
There are examples on the W3C Schools website and information relating to how Specificity is calculated and how you use it within your code.
I won't attempt to re-write or try to explain this any more than other websites. This is just a page relating to issues that I have come across that influenced my designs. For example, the higher precidence of ID selectors have a higher specificity than attribute selectors.
W3C say: