1#content ul li {
2 color : red;
3}
4
5ul li {
6 color : blue !important; /* overrides the red color */
7}
1/* The !important property in CSS means that all subsequent rules on
2an element are to be ignored, and the rule denoted by !important is
3to be applied. This rule overrides all previous styling rules -- the
4!important property increases its priority. */
5h1 {
6 background-color: red !important; /* Syntax */
7}
8/* The !important property is mentioned immediately before the semicolon */
1/*
2Applying css property to an element is like latest or last added css file styling will override all the design of HTML element.
3for e.g.
4added three css file in html document line by line
5<link rel="" href="stylesheet1.css">
6<link rel="" href="stylesheet2.css">
7<link rel="" href="stylesheet3.css">
8
9so from above file adding stylesheet3.css will override all duplicate styling.
10
11and if you want to more priorities your css then add inline css.
12
13But in critical sitution like if we don't want override any sytling of an specific element.
14then we use !important in css property value.
15
16!important is always on highest priority it works like styling that sticks to any element and never going to removed unless you remove !important from css property value.
17*/
18
19Syntax:
20div {
21 width: 100% !important;
22}
23
24/*
25I hope that above description about !important in css will help you.
26Namaste
27*/
1Hey! Using !important in your code means that you've done something wrong.
2Try avoiding it as much as possible.