CodeGuide
CodeGuide copied to clipboard
css部分意见
- !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;
}