HTML Paragraph


HTML can divide the document into several paragraphs.


HTML Paragraph

Paragraph is defined by the <p> tag.

Example

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

Try it »

Note:Browsers will automatically add blank lines before and after paragraphs (</p> is a block-level element).


Don't forget to close the tag

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

Example

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

Try it »

The examples work fine in most browsers, but don't rely on this method. Forgetting to use the closing tag will produce unexpected results and errors.

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


HTML Line Break

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

Example

<p>This<br>Paragraph<br>Demonstrates the effect of line breaks</p>

Try it »

<br /> element is an empty HTML element. Since there is no meaning to the closing tag, it does not have a closing tag.


HTML Output - Use Reminder

We cannot determine the exact effect of HTML being displayed on the screen. The size of the screen and the adjustment of the window can lead to different results.

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

When displaying the page, the browser removes any extra spaces and blank lines from the source code. All continuous spaces or blank lines are considered as one space. It is worth noting that all continuous blank lines (lines) in the HTML code are also displayed as one space.

Try it

(This example demonstrates some HTML formatting issues)


Examples

This is an example

HTML Paragraph
How to display HTML paragraphs in a browser.

Use line breaks in HTML documents.
Use line breaks in HTML code for layout.

Use line breaks in the layout of an HTML poem
Browsers display HTML by omitting extra whitespace characters (spaces or carriage returns, etc.) from the source code.

More Examples

More Paragraphs
Default behavior of paragraphs


HTML Tag Reference Manual

The tag reference manual provided by Example contains more information about HTML elements and their attributes.

Tag Description
<p> Define a paragraph
<br> Insert a single line break (line break)
Other extensions