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
[css] 第113天 标签、class和id选择器三者的区别是什么?分别在什么时候用? #1034
Comments
标签选择器选择标签名称,class 选择器选择 class 属性,id 选择器选择 id 属性。 对于 HTML 元素,class 属性可重,语义上代表元素所属的类别;id 属性不可重,语义上代表元素的标识符。 标签选择器的格式为 如果想让某种标签的全部元素都具有某种样式(e.g. 去除 |
|
标签选择器: |
标签选择器: 选择所有相同的dom节点名称的节点,可重复。 优先级 id》类》标签 |
三者的权重不同,都可以作为 CSS 的选择器使用。id > class > tag。 不过在一般的使用中, |
第113天 标签、class和id选择器三者的区别是什么?分别在什么时候用?
The text was updated successfully, but these errors were encountered: