HTML headings and paragraphs
HTML Titles and Paragraphs
<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 ParagraphAfter 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>回家變賣典質(zhì),父親 還了虧空;又借錢辦了喪事。這些日子,家中光景很是慘淡,一半為了喪事,一半為了父親賦閑。喪事完畢,父親要到南京謀事,我也要回北京念書,我們便同行。</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 LineThe<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 CommentsComments 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 codeHave 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.