!important Declaration

Increases the weight or importance of a particular declaration.

Syntax

HTMLsRule!important  }
ScriptingN/A

Possible Values

sRuleAny CSS attribute/value pair.

Example

The following example includes an !important declaration in the style rule. Normally the color of the text would be red, because inline styles override the rules set in a style tag. By including the !important declaration in the style rule, you set the content of the paragraph to green.

<STYLE>
    P { color:green!important }
</STYLE>
<P STYLE="color:red">This text will be green.</P>
This feature requires Microsoft Internet Explorer 4.0 or later. Click the following icon to install the latest version. Then reload this page to view the sample.

Standards Information

This declaration is defined in Cascading Style Sheets (CSS), Level 1 (CSS1) World Wide Web link.

Tags :


Page view tracker