How to set bold in css: You can use the font-family attribute to set it, such as [font-family: bold;]. The font-family attribute is used to specify the font of an element.
The operating environment of this article: windows10 system, css 3, Acer S40-51 computer.
font - The family attribute specifies the font of an element.
font-family can save multiple font names as a "fallback" system. If the browser doesn't support the first font, it will try the next one.
There are two types of font family names:
family-name - specified family name: the name of a specific font, such as: "times", "courier", "arial". generic-family - Common font family names: such as: "serif", "sans-serif", "cursive", "fantasy", "monospace.
Example:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <style> .s { font-family: SimHei; } .ss { font-family: 黑体; } </style> </head> <body> <p class="s">测试黑体</p> <p>普通字体</p> <p class="ss">测试黑体</p> </body> </html>
Running results:
Related recommendations: CSS tutorial
The above is the detailed content of How to set bold body in css. For more information, please follow other related articles on the PHP Chinese website!