Skip to content

css部分意见 #23

@longsp

Description

@longsp
  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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions