CSS之!important
作用:
将所设定的CSS属性的优先级最高,从而不被之后相同的css属性覆盖,即优先级最高。
场合:
除IE6浏览器之外的IE更高版本浏览器以及其它浏览器。
举例:
IE6中设置如下:
background-color: red !important;
background-color: green !important;
效果为: 背景色变为绿色。
IE8及其它浏览器中设置如下:
background-color: red !important;
background-color: green !important;
效果为: 背景色仍为红色。