font-weight

■ 定义

font-weight属性用于设置文字字体的粗细

■ 使用说明

属性值:

  normal: 默认值,不加粗

  bold: 定义粗体,加粗

  100-900:400等同于normal,而700等同于bold,注意这个数字后面不跟单位(推荐)

通过该属性,可让加粗标签(如<h>或<strong>)不加粗,或让其他标签加粗

实际开发中,更提倡用数字表示粗细

■ 示例

.bold {
    font-weight: bold;
}

.bold_num {
    font-weight: 700; /*等价于bold,实际开发中,更加提倡使用数字*/
}

.normal {
    font-weight: normal;
}

.normal_num {
    font-weight: 400; /*等价于normal,实际开发中,更加提倡使用数字*/
}
<p class="bold">加粗字体1</p>
<p class="bold_num">加粗字体2</p>

<p class="normal">正常字体1</p>
<p class="normal_num">正常字体2</p>
原文地址:https://www.cnblogs.com/shiliye/p/14144722.html