Paragraph Tag 段落标签

The paragraph tag <p> represents a paragraph of text within an HTML document.

段落标签<p>表示HTML文档中的文本段落。

Paragraphs are usually rendered with a small space between each paragraph, but this is dependent on the default settings of the browser. Browsers do not always render a space between paragraphs; however this is the normal convention.

段落通常在每个段落之间留有一小部分空间,但这取决于浏览器的默认设置。浏览器并不总是在段落之间显示空格;然而,这是正常的惯例。

Note: The paragraph tag <p> should only be used when there are no other more appropriate tags that could be used. For example, the address tag <address> is more suitable for providing contact details, and the footer tag <footer> is more appropriate for footer content such as copyright notices.

注:只有在没有其他更合适的标签可供使用时才应使用段落标签。例如,地址标签<address>更适合提供联系人详细信息,页脚标签<footer>更适合于页脚内容,如版权声明。

Syntax 语法:

The paragraph tag <p> tag is written as <p>   </p> with the text of the paragraph inserted between the start and end tags.

段落标签写为 <p>   </p> ,段落文本插入起始标签和结束标签之间。

Example:

Instructions: Retype this code in an HTML editor and then load the webpage in a browser of your choice. Then once you have loaded the page try experimenting with the code. Making a few small changes and then preview how those changes affected your webpage. Once you are comfortable with this HTML Tag you should proceed to the next example.

This document will show how different tags can display information on a website to the end user. Using the correct tags, even though the visual appearance of the content may look the same is important when writing effective HTML code.

本文档将展示不同的标签如何向最终用户显示网站上的信息。在编写有效的HTML代码时,使用正确的标签非常重要,即使内容的视觉外观看起来可能相同。

Think about this: If you can include a copyright notice using a paragraph tag <p> why would you use a footer tag <footer> instead? Why would you not just use a paragraph tag <p> for everything?

思考:如果可以使用段落标记<p> 包含版权声明,为什么你要使用页脚标记<footer>呢?为什么不在所有地方都使用段落标记?

Proceed to the next example: Line Break Tag