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

🤖

ChatGPT Free
Ask questions on any topic

CITE ARTICLE


For homework, research, thesis, books, magazines, blogs or academic articles

APA Format Reference:

Delgado, Hugo. (2019).
The !important rule in CSS.
Retrieved Mar 16, 2024, from
https://disenowebakus.net/en/important-rule-css

Participates!

Share it with your friends 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.

CONTINUE LEARNING

IT ALSO DESERVES TO PAY TO VISIT:

Not finding what you need?

Use our internal search to discover more information
Related content:

Would you like to learn more about Web Design?

Meet all the courses and tutorials that we have for you completely free
Learn Web Design
 

Leave your Comment

SPONSOR

Your business can also appear here. More information

Next article:

Your browser has blocked advertising.
Please 🙏 allow to visualize the announcements to be able to access, thank you.