!important提升指定样式规则的应用优先权。
ps:IE6及更早浏览器下,!important在同一条样式内不生效。
div{color:#f00!important;color:#000;}
在上述代码中,IE6及以下浏览器div的文本颜色为#000,!important并没有覆盖后面的规则;其它浏览器下div的文本颜色为#f00。
div{color:#f00!important;}
div{color:#000;}
在上述代码中,IE6及以下浏览器中div的文本颜色表现与其它浏览器一致,都为#f00。