Skip to content
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部分意见 #23

Open
longsp opened this issue Nov 29, 2019 · 0 comments
Open

css部分意见 #23

longsp opened this issue Nov 29, 2019 · 0 comments

Comments

@longsp
Copy link

longsp commented Nov 29, 2019

  1. !important使用规则
    “!important”只能主动使用,不能被动使用。
    我们主动命名一些公共样式时,为了保证不被意外内容覆盖,可以使用"!important", 如:
.hidden {
  display: none !important;
}

而不是被动等问题发生后,用来取巧, 如:

<div class="content">
  <h2 class="heading-sub">...</h2>
</div>
.content h2 {
  font-size: 2em;
}

.heading-sub {
  font-size: 1.5em !important;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant