The important declaration

suggest change

The !important flag raises a declaration's cascade priority above normal declarations, including ones with higher specificity. Its usage is: property: value !important;

#mydiv {
    font-weight: bold !important;    /* This property won't be overridden
                                       by the rule below */
}

#outerdiv #mydiv {
    font-weight: normal;            /* #mydiv font-weight won't be set to normal
                                    even if it has a higher specificity because
                                    of the !important declaration above */
}

Avoiding the usage of !important is strongly recommended (unless absolutely necessary), because it will disturb the natural flow of css rules which can bring uncertainty in your style sheet. Also it is important to note that when multiple !important declarations are applied to the same rule on a certain element, the one with the higher specificity will be the one applied.

Here are some examples where using !important declaration can be justified:

See also:

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents