CSS!important function is to improve the application priority of the specified CSS style rules
!important is the syntax defined by CSS1, which is to increase the application priority of the specified style rule. The syntax format {cssrule!important}, which is written on the last face of the definition, for example: Box{color:red!important;} In CSS, by declaring to a certain style! Important, you can change the default CSS style precedence rule so that the bar Style property declaration has the highest priority, which is equivalent to writing at the bottom. Promotes application precedence for a specified style rule.
IE6 and the following browsers for the!important to take effect, the following code is available:
Example code:
div{color:#f00!important;}div{color:#000;}
In the above code, IE6 and the following browsers in the text color of the div is consistent with other browsers, are #f00
Role: Write Browser compatibility
CSS hack because of different vendors ' browsers, such as the Internet Explorer,safari,mozilla Firefox,chrome, or different versions of the same vendor's browser, such as IE6 and IE7, The parsing of CSS is not exactly the same, so the resulting page effect is not the same, and the page effect we need is not. At this time we need to write different CSS for different browsers, so that it can be compatible with different browsers, can be in different browsers can also get the desired page effect.
The CSS important stuff.