Increases the weight or importance of a particular rule.
Syntax
HTML { sAttribute:sValue!important } Scripting N/A
Possible Values
sAttribute Any cascading style sheets (CSS) attribute. sValue Any of the range of values available to the corresponding attribute. The declaration has no default value.
Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see Dynamic Properties.
Example
This example includes the !important declaration in the style rule. The color of the text normally would be green, because inline styles overrule the rules set in a style tag. By including the !important declaration in the style rule, the content of the paragraph is instead set to red.
Sample Code
<STYLE> P {color:red!important} </STYLE> <P STYLE="color:green">This will be red.</P>
Applies To
A, ADDRESS, B, BIG, BLOCKQUOTE, BODY, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, DD, DFN, DIR, DIV, DL, DT, EM, FIELDSET, FORM, Hn, HTML, I, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=hidden, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, KBD, LABEL, LEGEND, LI, LISTING, MARQUEE, MENU, OL, P, PLAINTEXT, PRE, S, SAMP, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, XMP