当前位置:懂科普 >

IT科技

> css选择器优先级顺序

css选择器优先级顺序

系统版本:windows7

选择器的优先级

在属性后面使用 !important 会覆盖页面内任何位置定义的元素样式。

作为style属性写在元素内的样式

id选择器

类选择器

元素选择器

通配符选择器

浏览器自定义或继承

总体总结的CSS排序为:!Important>行内样式>ID选择器>类选择器>元素>通配符>继承>浏览器默认属性

 

css选择器优先级顺序
标签: 优先级 css 选择器
  • 文章版权属于文章作者所有,转载请注明 https://dongkepu.com/itkeji/y48rrk.html