In this chapter, we will start introducing the commonly used tags on web pages to you one by one. When studying this chapter, remember to pay attention to two aspects of learning in the process of learning html tags: the purpose of tags and the default style of tags in the browser.
What is semantics? To put it simply, it is to understand the purpose of each tag (under what circumstances is this tag reasonable to use). For example, the title of the article on the web page can be used as the title tag, and the column names of each column on the web page can also be used as the title tag. The paragraphs in the article must be placed in the paragraph label. If there is text to emphasize in the article, you can use the em label to express emphasis, etc.
2.2 Body tag, the content displayed on the web page is placed hereThe content of the page to be displayed on the web page must be placed in the body tag. The following picture is a news article webpage.
The browser effect is as follows:
2.3 p tag, add paragraph If you want to display an article on a web page, you need to use the <p> tag and place the paragraphs of the article in the <p> tag.
Syntax: <p>段落文本</p> Pay attention to a paragraph of text and a label. If there are 3 paragraphs in a news article, you should put these 3 paragraphs into the 3 <p> tags respectively. As shown in the figure below:
The browser displays the following effect:
The default style of the <p> tag can be seen in the figure above. There will be blanks before and after the segment. If you don’t like this blank, you can use the css style to delete or change it. Paragraph verification code:
XML/HTML Code Copy content to clipboard