" or "" tag to wrap the paragraph text; 2. Set "font-weight:bold|bolder;" to the paragraph tag (for example, p). Just style it, and the font-weight attribute sets the thickness of the text."/> " or "" tag to wrap the paragraph text; 2. Set "font-weight:bold|bolder;" to the paragraph tag (for example, p). Just style it, and the font-weight attribute sets the thickness of the text.">

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

How to bold a paragraph in html

青灯夜游
青灯夜游Original
2021-03-02 16:35:404713browse

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>

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>

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!

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