Handling specificity
It is also possible to add the designation !important
to a rule, which then is given the highest priority among all rules with exactly the same selectors (that is, all other rules with the same selectors are ignored). This is to be avoided, where possible, as it is a rather blunt instrument to use. As such, it might constrain future updates or hide the reasons behind styling.
One way to avoid "specificity wars" is by using classesAn attribute assigning an element to a named class. where possible instead of IDsAn attribute specifying a unique identifier for an element..
Each browser has a tool allowing you to see all the rules that are applied to a particular element, typically by right-clicking or control-clicking and then choosing "Inspect element".