CSS:Cascading Style Sheet 层叠样式表
- 元素选择器 a{}
- 伪元素选择器 ::before{}
- 类选择器 .link{}
- 属性选择器 [type=radio]{}
- 伪类选择器 :hover{}
- ID选择器 #id{}
- 组合选择器 [type=checkbox] + label{}
- 否定选择器 :not(.link){}
- 通用选择器 *{}
选择器权重
- ID选择器 +100
- 类 伪类 属性 +10
- 元素 伪元素 +1
- 其它选择器 +0
!important 优先级最高
.test{color:red!important;}
元素属性优先级高
相同权重,后写的生效
来源:CSDN
作者:超人不会飞/
链接:https://blog.csdn.net/ChristWTF/article/details/103738434