从理论上讲,如果你有这种情况:
<style type="text/css"> .class1 { color:#F00 !important; } .class2 { color:#00F !important; } </style> <p class="class2 class1">Test</p>
哪种颜色应该优先?在这种情况下,浏览器如何确定优先级?
解决方法
根据这个来源:
http://www.boogiejack.com/CSS_4.html
class2应该覆盖class1样式。
Order of Specification: As a last resort,when all other conflict resolution specifications cannot determine which style should take precedence,the last style specified will be the style used.