English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Basic Tutorial

HTML Media

HTML Reference Manual

HTML5 Basic Tutorial

HTML5 API

HTML5 Media

HTML Paragraphs

HTML can divide a document into several paragraphs. The content of the article is usually also composed of multiple paragraphs.

HTML Paragraphs

Paragraphs are defined by the <p>  tag.

<p>This is the first paragraph (oldtoolbag.com) </p><p>This is the second paragraph</p>
Test to see ‹/›

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

Do not forget to close the tag

Of course, even if you forget to use the closing tag, most browsers will still display the HTML:

<p>This is the first paragraph
<p>This is the second paragraph
Test to see ‹/›

The above example will work in most browsers, but do not use this method. Forgetting to use the closing tag can produce unpredictable errors, causing the page content to be misaligned and affecting the page layout, etc.

Note: Do not forget to close the tag

HTML Line Break

If you just want to break lines of plain text content and not create a new paragraph, please use <br>or<br /> For line breaks, use the tag:

<p>This is a<br>normal line break within a paragraph<br>This demonstrates the effect of line breaks</p>
Test to see ‹/›

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

HTML output- Use reminders

We cannot determine the exact effect of the displayed HTML. The size of the screen and adjustments to 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 will remove extra spaces and blank lines from the source code. All consecutive spaces or blank lines are counted as one space. It should be noted that all consecutive blank lines (line breaks) in the HTML code are also displayed as one space.

Try it out

(This example demonstrates some possible formatting issues that may be encountered with HTML).

Example on this site

HTML Paragraphs
How to display HTML paragraphs in a browser.

HTML Line Break
Using line breaks in HTML documents

Formatting a poem in HTML
When displaying HTML code, browsers will automatically omit extra whitespace characters, spaces, and line breaks from the source code (such as...).

More examples

More paragraphs
The default behavior of paragraphs

HTML Tag Reference Manual

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

TagsDescription
<p>Define a paragraph
<br>Insert a single line break (newline)