HTML headings and paragraphs

HTML Titles and Paragraphs


##HTML Title

Heading (Heading) is defined through <h1> - <h6> tags.

<h1> Defines the largest title. <h6> Defines the smallest heading.

<html>
<head>
<meta charset="utf-8">
</head>
<body>
<h1>我是最大的</h1>
<h2>我是第二大的</h2>
<h3>我是第三大的</h3>
....
<h6>我是最小的</h6>
</body>
</html>

Note: The browser will automatically add blank lines before and after the title.

Titles are important

Make sure to use the HTML title tag only for titles. Don’t use headings just to produce bold or large text.

Search engines use headers to index the structure and content of your web pages.

Because users can quickly navigate your web page through headings, it is important to use headings to present the structure of your document.

H1 should be used as the main heading (the most important), followed by h2 (the next most important), then h3, and so on.

HTML Paragraph

After the title, there will be a paragraph. The paragraph is defined with the <p></p> tag. For example, a paragraph of text, you want to divide it into paragraphs. You can use the <p> tag:

<html>
<head>
<meta charset="utf-8">
</head>
<body>
<h1>《背影》-朱自清</h1>
<p>我与父亲不相见已二年余了,我最不能忘记的是他的背影。</p>那年冬天,祖母死了,父亲的差使也交卸了,正是祸不单行的日子。我从北京到徐州打算跟着父亲奔丧
回家。到徐州见着父亲,看见满院狼藉的东西,又想起祖母,不禁簌簌地流下眼泪。父亲说:“事已如此,不必难过,好在天无绝人之路!”</p><p>回家变卖典质,父亲
还了亏空;又借钱办了丧事。这些日子,家中光景很是惨淡,一半为了丧事,一半为了父亲赋闲。丧事完毕,父亲要到南京谋事,我也要回北京念书,我们便同行。</p>
</body>
</html>

Although the text in the example is not displayed in segments, the <p> tag is used to display the segments when running on the web page. This is <p> The role of labels.

HTML Horizontal Line

The<hr> tag creates a horizontal line in an HTML page.


<html>
<head>
<meta charset="utf-8">
</head>
<body>
<h1>我是最大的</h1>
<hr>
<h2>我是第二大的</h2>
<hr>
<h3>我是第三大的</h3>
<hr>
....
<h6>我是最小的</h6>
</body>
</html>

HTML Comments

Comments can be inserted into HTML code, which can improve its readability and make the code easier to understand. The browser ignores comments and does not display them.

The comment is written as follows:

<!-- Comment -->

HTML Tip-How to view the source code

Have you seen some The page then marveled at how it was accomplished.

If you want to find out the secret, just right-click and select "View Source" (IE) or "View Page Source" (Firefox). Other browsers do the same thing. Doing so will open a window containing the HTML code for the page.


Continuing Learning
||
<html> <head> <meta charset="utf-8"> </head> <body> <h1>我是最大的</h1> <h2>我是第二大的</h2> <h3>我是第三大的</h3> .... <h6>我是最小的</h6> </body> </html>
submitReset Code