权重

样式权重

外联内联以加载顺序为准,后覆盖前

  内嵌 id class 元素
  a b c d
内嵌 1 0 0 0
id 0 1 0 0
class、属性、伪类 0 0 1 0
元素、伪元素 0 0 0 1
通配符* 0
!important 最高

通配符*

选择所有元素,权重最低

原文地址:https://www.cnblogs.com/pq1234/p/7183344.html