122 of 313 menu

The !important flag

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

Syntax

selector { property: value !important; }

Example

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

<div>text</div> div{ 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
enbyfruzsv