The !important flag

The !important flag gives precedence to a style or any CSS property for which it is specified.

Syntax

cssselector {
  property: value !important;
}

Example

Let's make blue paragraph font color take precedence over green color:

html<div>text</div>
cssdiv{
  color: blue !important;
  width: 600px;
  height: 100px;
  font-size: 20px;
}
div {
  color: green;
}

Результат:

See also

  • the @import command
    that imports a CSS file
  • the @media command
    that specifies a style for a media type
  • the @supports command
    that sets a style for elements whose capabilities are supported by the browser