In CSS, you can use the "font-weight" attribute to set boldness. You only need to set the "font-weight:bold|700" style to the element. The font-weight attribute sets the thickness of the text. The numeric value 700 is equivalent to bold. When the value is bold, it means defining bold characters.
The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.
Create a new HTML page, add the HTML structure, and then add fonts in the body area, placing it in a div.
<body> <div>枯藤老树昏鸦</div> </body>
Next, you can use font-weight to set boldness in CSS. You only need to set bold.
<style> div { font-weight: bold; } </style>
After running the page, you can see that the font is bolded
In addition, font-weight can also be set to a value from 100 to 900. Larger numbers are bolder.
<style> div { font-weight: 100; } </style>
When font-weight is set to 100, the font is the thinnest
Finally, when font-weight is set to 900, it is The thickest
Recommended learning: css video tutorial
The above is the detailed content of How to set bold in css. For more information, please follow other related articles on the PHP Chinese website!