Home > Web Front-end > HTML Tutorial > How to bold a paragraph in html

How to bold a paragraph in html

青灯夜游
Release: 2023-02-06 19:28:29
Original
4716 people have browsed it

How to bold a paragraph in HTML: 1. Use the "" or "" tag to wrap the paragraph text; 2. Set "font" for the paragraph tag (for example, p) -weight:bold|bolder;" style, the font-weight attribute sets the thickness of the text.

How to bold a paragraph in html

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

htmlParagraph bold

1. Use or tags

tag defines bold text.

A tag is a phrase tag that defines important text for a sample of a computer program.

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
	</head>
	<body>
		<p>
			<b>段落文字加粗</b>
		</p>
	
		<p>
			<strong>段落文字强调,加粗</strong>
		</p>
	</body>
</html>
Copy after login

Rendering:

How to bold a paragraph in html

2. Use the font-weight attribute

font-weight Property sets the thickness of the text.

Attribute value:

  • bold Defines bold characters.

  • #bolder Defines bolder characters.

Example:

<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<style>
			p.normal {
				font-weight: normal;
			}
			
			
			p.bold {
				font-weight: bold;
			}
			
			p.bolder {
				font-weight: bolder;
			}
		</style>
	</head>

	<body>
		<p class="normal">测试文本段落。</p>
		<p class="bold">测试文本段落。</p>
		<p class="bolder">测试文本段落。</p>
	</body>

</html>
Copy after login

Rendering:

How to bold a paragraph in html

[Recommended tutorial: html video tutorialcss video tutorial

The above is the detailed content of How to bold a paragraph in html. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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