The way to set the font bold effect in css is to add the font-weight attribute to the font and set the attribute value to bold or bolder, such as [font-weight:bolder] or [font-weight:bold] .
The operating environment of this article: windows10 system, css 3, thinkpad t480 computer.
To achieve a bold font effect, we can use the font-weight attribute, which can set the thickness of the text.
Attribute value:
normal Default value. Defines standard characters.
#bold Defines bold characters.
#bolder Defines bolder characters.
#lighter Defines finer characters.
Example:
<html> <head> <style type="text/css"> p.normal {font-weight: normal} p.thick {font-weight: bold} p.thicker {font-weight: 900} </style> </head> <body> <p class="normal">This is a paragraph</p> <p class="thick">This is a paragraph</p> <p class="thicker">This is a paragraph</p> </body> </html>
Running effect:
Related recommendations: css video tutorial
The above is the detailed content of How to set font bold effect in css. For more information, please follow other related articles on the PHP Chinese website!