Site icon Tutorial

Important Usage

It is used  to override the cascade in CSS. The !important syntax appears within a declaration, after the property value and before the semicolon that terminates the declaration.  It has two parts
As shown in the example
p {
background: #fff !important;
}
A declaration having the !important rule, always takes precedence over any other declaration even above the style attribute of the HTML element. If more than one !important rule is in a style sheet then the latter rule is applied over any given earlier. Hence, it advised to not to use it as it also makes it harder to define any other rules and makes site maintenance more difficult.
Go To- Certified CSS3 Developer Tutorial
Exit mobile version