We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
选择器的基本规则大致是是以下的方式,基本的作用就是选择 html 元素
html
选择器{ 属性 值; 属性 值 }
需要注意的是,浏览器去找元素的时候,是从右往左 的方式
从右往左
div .box a { }
!important > 内联样式 = 外联样式 > ID选择器 > 类选择器 = 伪类选择器 = 属性选择器 > 元素选择器 = 伪元素选择器 > 通配选择器 = 后代选择器 = 兄弟选择器
这里会牵扯一个权重的问题 直观来看
10000:!important 1000:内联样式、外联样式 100:ID选择器 10:类选择器、伪类选择器、属性选择器 1:元素选择器、伪元素选择器 0:通配选择器、后代选择器、兄弟选择器
基本的选择器
伪元素
层次选择器
优先级高的层叠优先级较低 的样式,其实是比较复杂的问题
通过 color: powderblue !important; 提高自己的权重(其优先级是最高的),那相同的权重后写的生效
color: powderblue !important;
The text was updated successfully, but these errors were encountered:
No branches or pull requests
title: 请说说
css
的选择器以及选择器优先级前言
选择器的基本规则大致是是以下的方式,基本的作用就是选择
html
元素需要注意的是,浏览器去找元素的时候,是
从右往左
的方式!important > 内联样式 = 外联样式 > ID选择器 > 类选择器 = 伪类选择器 = 属性选择器 > 元素选择器 = 伪元素选择器 > 通配选择器 = 后代选择器 = 兄弟选择器
这里会牵扯一个权重的问题 直观来看
选择器
选择器的基本分类
选择器的权重
优先级高的层叠优先级较低 的样式,其实是比较复杂的问题
通过
color: powderblue !important;
提高自己的权重(其优先级是最高的),那相同的权重后写的生效The text was updated successfully, but these errors were encountered: