How to set bold body in css

藏色散人
Release: 2023-01-04 09:35:33
Original
10744 people have browsed it

How to set boldface in css: first create an HTML sample file; then create text content in the body; finally, add the "font-family: boldface;" attribute to the specified text to set it to boldface.

How to set bold body in css

The operating environment of this article: Windows7 system, HTML5&&CSS3 version, Dell G3 computer.

How to set bold style in css?

css To set the font, you can use the font-family attribute. To set it to Song Dynasty, you can use font-family: 黑体; or font-family: SimHei; .

font-family: Specifies the font family of the 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. That is, the value of the font-family attribute is a precedence list of font family names or/and class family names to use for an element. The browser will use the first value it recognizes.

There are two types of font family names:

Specified series name: the name of a specific font, such as: "times", "courier", "arial".

Usual font family names: For example: "serif", "sans-serif", "cursive", "fantasy", "monospace"

Tip: Separate each value with a comma, and Always provide a family name as a last resort.

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>
Copy after login

Rendering:

How to set bold body in css

[Recommended learning: css video 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!

Related labels:
css
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template