我正面临一个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;
}Run Code Online (Sandbox Code Playgroud)
<!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>Run Code Online (Sandbox Code Playgroud)
没有font-weight:small;.我想你的意思font-weight:normal;或font-size:small;.
另请参见CSS字体模块级别3:3.2字体粗细:font-weight属性.