Search
Close this search box.
Search
Close this search box.

What is !important

When a CSS propriety is specified twice, the browser will commonly use the last one. Let’s see an example:

#main {
width:600px;
width:800px;
}

In this example the browser will assign width 800 pixels to the #main element.

The declaration !important can be used in cascading style sheets to give priority to some parameters.

#main {
width:600px !important;
width:800px;
}

In the example above the browser will give priority to the first declaration and the #main element will be 600 pixels width.