What is the !important CSS rule? General October 26, 2005 Comments Off
CSS tries to create a balance of power between author and user style sheets. By default, rules in an author’s style sheet override those in a user’s style sheet.
However, for balance, an “!important” declaration takes precedence over a normal declaration. Both author and user style sheets can contain “!important” rules, but user “!important” rules override author “!important” rules.
Note: In CSS1, it works the other way: Author “!important” rules took precedence over user “!important” rules.
If you, in your style sheet want to mark something as important, use the following code:
P { font-size: 18pt ! important }
You are telling your user, that it is important, that you use 18pt, as your fontsize.
Related posts:
- Lean startups: low burn by design Summary of the strategy of building low-burn-rate startups, i.e. capital...
Related posts brought to you by Yet Another Related Posts Plugin.