Home  >  Article  >  Web Front-end  >  How to set bold body in css

How to set bold body in css

王林
王林Original
2021-01-30 15:41:348672browse

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:

How to set bold body in css

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!

Statement:
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
Previous article:css style priority ruleNext article:css style priority rule