HTML Paragraph

HTML can divide a document into several paragraphs.

HTML paragraph

The paragraph is defined by the <p> tag.

Example

<p>This is a paragraph</p>
<p>This is another paragraph</p>

Note: The browser will automatically add blank lines before and after the paragraph. (</p> is a block-level element)

Don’t forget the closing tag

Even if you forget to use the closing tag, most browsers will display the HTML correctly:

Example

<p>This is a paragraph
<p>This is another paragraph

The above example is fine in most browsers, but don’t rely on this approach. Forgetting to use the closing tag can produce unexpected results and errors.

Note: In future HTML versions, it is not allowed to omit the closing tag.

HTML wrapping

If you want to wrap (new line) without creating a new paragraph, use the <br> tag:

Example

<P> This <br> paragraph <br> demonstrates the effect of branches </P>

The <br /> element is an empty HTML element. Since the closing tag has no meaning, it has no closing tag.

HTML output-usage reminder

We are unable to determine the exact effect of the HTML being displayed. The size of the screen and the adjustment of the window may lead to different results.

For HTML, you cannot change the output effect by adding extra spaces or line breaks in the HTML code.

When the page is displayed, the browser will remove extra spaces and blank lines in the source code. All consecutive spaces or blank lines will be counted as one space. It should be noted that all consecutive blank lines (newlines) in the HTML code are also displayed as a space.

try it

(This example demonstrates some HTML formatting issues)

Examples of this site

HTML paragraph
How to display HTML paragraph in the browser.

Line break
Use line breaks in HTML documents.

Typesetting a Tang poem in HTML code When the
browser displays HTML, it will omit extra blank characters (spaces or carriage returns, etc.) in the source code.

More examples

More paragraphs
The default behavior of paragraphs.

HTML Tag Reference Manual

The tag reference manual of the rookie tutorial provides more information about HTML elements and their attributes.

Label
Description
<pr>
Define a paragraph
<br>
Insert a single line break (line break)