The !important rule in CSS

The keyword! Important is used to give higher priority to an instruction, so that the following instructions cannot be used. overwrite it Priority is given to all other specifications .

The !important rule in CSS | Learn CSS | The keyword! Important is used to give higher priority to an instruction, so that the following instructions cannot be used. overwrite it Priority is given to all other specifications

The keyword! Important is used to give higher priority to instructions, so that the following instructions can not overwrite it. It is given priority over all other specifications.

Let's see its syntax in an example:

p {
color: #000066 !important;
}

All the paragraphs <p> have the blue (# 000066) as the foreground color. The following instructions on the foreground color will not be valid.

The! Important rule should always be at the end of the declaration, that is, immediately before the period and as final (;) or the following statement (combined).

The instructions declared as! Important in the user's style sheet take precedence over the instructions in the author's style sheet, even when these are also accompanied by !important

Did you like it or was it useful?

Help us share it in Social Networks

Professor at the University of Guadalajara

Hugo Delgado Desarrollador y Diseñador Web en Puerto Vallarta

Professional in Web Development and SEO Positioning for more than 10 continuous years.
We have more than 200 certificates and recognitions in the Academic and Professional trajectory, including diploma certificates certified by Google.

IT ALSO DESERVES TO PAY TO VISIT:

Not finding what you need?

Use our internal search to discover more information
Sponsored content:
 

Leave your Comment

SPONSOR

Your business can also appear here. More information