When use !important ?


Well-known member
CSS will always use the MOST DESCRIPTIVE declaration.

td { padding: 5px; } // least important
tr td { padding: 5px; }
table tr td { padding: 5px; }
body table tr td { padding: 5px; }
html body table tr td { padding: 5px; } // most important
If you can, always try to use a more descriptive declaration instead of using !important. However, if you must, there is really no technical harm in using it; don't let people like the author of the above article scare you. The real issue you will have is if you are writing addons, as the code may interfere with some people's skins.


Well-known member
I don't think the article is trying to scare, it is just exemplifying good practice. Using higher specificity over !important is always the better option, and in the long run more maintainable. xF is built up that way, otherwise we could not have had so many shared css classes between completely different elements.