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
!important拥有最高的权限,比如下面是别人CSS,如何覆盖width呢?
!important
width
#div { width: 100px !important; }
除了使用更高权重的选择器+!important,还可以使用max-width和min-width
更高权重的选择器+!important
max-width
min-width
#div { min-width: 200px; max-width: 200px; }
The text was updated successfully, but these errors were encountered:
补充一个: important这个尽量不要用,因为他会破坏层叠样式表权重的计算规则,如果写了多条!important导致样式很难排查问题。
另外,我补充了一个文章: https://yatoo2018.github.io/Yatoo/2018/07/31/CSS-Cascade.html 没有加评论系统,先凑合看下
Sorry, something went wrong.
No branches or pull requests
!important
拥有最高的权限,比如下面是别人CSS,如何覆盖width
呢?除了使用
更高权重的选择器+!important
,还可以使用max-width
和min-width
The text was updated successfully, but these errors were encountered: