How to set bold body in css

王林
Release: 2022-12-30 11:13:10
Original
8683 people have browsed it

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

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!

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!