zjffun blog

CSS 样式优先级

更新于 写于 CSSpriority

用户代理(浏览器)样式声明、插件样式声明和网站作者样式声明的优先级:

  1. Declarations in user agent style sheets (e.g. the browser's default styles, used when no other styling is set).
  2. Normal declarations in user style sheets (custom styles set by a user).
  3. Normal declarations in author style sheets (these are the styles set by us, the web developers).
  4. Important declarations in author style sheets
  5. Important declarations in user style sheets

参见