【发布时间】:2018-06-05 18:49:41
【问题描述】:
我在 CSS 覆盖“font-weight”属性时遇到了一个奇怪的问题。下面给出了显示问题的代码:-
元素'p'的'font-weight'设置为小(颜色设置为紫色)。但字体在 FF/Chrome 上仍呈现为粗体,而颜色覆盖为紫色。
知道为什么会这样吗?
p {
font-weight: small;
color: purple;
}
#speciality_test {
font-weight: bold;
color: red;
}
.class_speciality_test {
font-weight: bold;
color: red;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
</head>
<body>
<div id="speciality_test">
<p>
Inside identifier... HTML CSS test pages.
</p>
</div>
<div class="class_speciality_test">
<p>
Inside class... HTML CSS test pages.
</p>
</div>
</body>
</html>
【问题讨论】: