Why is the font bold attribute in the css file?

青灯夜游
Release: 2021-12-10 12:52:30
Original
3445 people have browsed it

In the css file, the font bold attribute is "font-weight". This attribute can set the thickness of the font text. When the attribute value is set to "bold", bold characters can be defined. Set to " bolder" to define bolder characters.

Why is the font bold attribute in the css file?

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

In the css file, the font bold attribute is "font-weight".

The font-weight attribute can set the thickness of the text and supports multiple attribute values:

Value Description
normal Default value. Defines standard characters.
bold Define bold characters.
bolder Define bolder characters.
lighter Define finer characters.
  • 100
  • 200
  • 300
  • 400
  • 500
  • 600
  • 700
  • 800
  • 900
Define characters from thin to thick. 400 is equivalent to normal, and 700 is equivalent to bold.

Example:

<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<title>css 文字加粗</title>
		<style>
			p.normal {
				font-weight: normal;
			}
			p.bold {
				font-weight: bold;
			}
			
			p.bolder {
				font-weight: bolder;
			}
			
			p.thicker {
				font-weight: 900;
			}
		</style>
	</head>

	<body>
		<p class="normal">测试文本!</p>
		<p class="bold">测试文本!</p>
		<p class="bolder">测试文本!</p>
		<p class="thicker">测试文本!</p>
	</body>

</html>
Copy after login

Why is the font bold attribute in the css file?

(Learning video sharing: css video tutorial)

The above is the detailed content of Why is the font bold attribute in the css file?. 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