-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
选择器及样式优先级 #13
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
选择器
主要分成三种等级
1、id选择器,权重100
2、类选择器(
class
)、属性选择器(如[type="radio"]
)、伪类选择器(如:hover
),权重103、标签选择器(如
h2
)、伪元素(如::after
),权重1样式优先级
除了选择器的权重之外,影响样式还有另外两个特殊的规则:
!important
、内联样式
!important
它的层级最高,会覆盖任何其他声明The text was updated successfully, but these errors were encountered: