In CSS, the font thickness can be modified with the font-weight attribute. You only need to set the value of the font-weight attribute to "bold", "bolder", "lighter" or "500" or "600" , "700", "800", and "900" are sufficient. The larger the attribute value, the bolder the font.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
In CSS, the font thickness can be modified using the font-weight attribute.
CSS font-weight property
The font-weight property can be used to set the thickness of text. The larger the attribute value, the bolder the font.
Attribute value:
Value | Description |
---|---|
normal | default value. Defines standard characters. |
bold | Define bold characters. |
bolder | Define bolder characters. |
lighter | Define finer characters. |
|
Define characters from thin to thick. 400 is equivalent to normal, and 700 is equivalent to bold. |
Example:
css 文字加粗 这是一段测试文字--默认粗细
这是一段测试文字
这是一段测试文字
这是一段测试文字
这是一段测试文字
这是一段测试文字
这是一段测试文字
这是一段测试文字
这是一段测试文字
这是一段测试文字
[Recommended tutorial:CSS video tutorial]
The above is the detailed content of How to change font thickness in css. For more information, please follow other related articles on the PHP Chinese website!