!important forces the statement to always apply, doing these things:
- even if the selector is less specific and lower level, it now beats higher specificity selectors
- if there are further occurrences of that statement that would normally override that one, it does not override the important statement any more
Most of the time, !important can be avoided because specificity of selectors handles which one takes effect, which is the idea of cascading styles. However, there are some situations (can't quite remember the exact one) where the specificity isn't that logical and I have to force !important on the statement.
Reasons not to use/avoid !important?
- prevents users from using custom stylesheets (which now can't override the rules that are marked as important) which breaks accessibility for some people
- makes code more difficult to read because the mind normally takes specificity quite easily, but remembering what is
!importantmakes it harder to read - lacks full IE support before version 7 (I don't care about IE, but you may)