
- HTML Tutorial
- HTML - Home
- HTML - Overview
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Comments
- HTML - Images
- HTML - Tables
- HTML - Lists
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Frames
- HTML - Iframes
- HTML - Blocks
- HTML - Backgrounds
- HTML - Colors
- HTML - Fonts
- HTML - Forms
- HTML - Embed Multimedia
- HTML - Marquees
- HTML - Header
- HTML - Style Sheet
- HTML - Javascript
- HTML - Layouts
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- HTML - Fonts Ref
- HTML - Events Ref
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
What are the implications of using "!important" in CSS?
The !important rule overrides all previous styling rules. It is based on the concept of priority or specificity. The !important rule provides a way to make your CSS cascade. It also includes the rules that are to be applied always. A rule having the !important property will always be applied, no matter where that rule appears in the CSS document. Let us see an example −
Priority - Without Using !important
Example
Let us first see an example how the specificity and priority works without using the !important −
<!DOCTYPE html> <html> <head> <style> .mycolor{ color: red; } .mycolor{ color: orange; } </style> </head> <body> <h1>Checking Priority</h1> <div class='mycolor'> This is orange colored </div> </body> </html>
Output

Priority - Using !important
Example
Now, we will see an example how the specificity and priority works using the !important −
<!DOCTYPE html> <html> <head> <style> .mycolor{ color: red !important; } .mycolor{ color: orange; } </style> </head> <body> <h1>Checking Priority</h1> <div class='mycolor'> This is red colored because we used !important to override </div> </body> </html>
Output

- Related Articles
- What are the social implications of data mining?
- What are the Major Implications of the Finance Theory?
- What are the implications of Sustainable Growth on Financial Performance?
- What are the important components of ODBC?
- What are the important components of JDBC?
- Usage of CSS !important rule
- What are the important characteristics of Living Beings?
- What are the important methods of the SQLException class?
- What are the three important steps in the evaluation of investments?
- What are the various important exceptions in Selenium?
- What are the Important Array Methods in JavaScript?
- What are the important places of pilgrimage for Hindus?
- What are the important roles of a Financial Manager?
- What are some of the important features of Investment Decisions?
- When is the !important rule used in CSS?

Advertisements