English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
HTML can divide a document into several paragraphs. The content of the article is usually also composed of multiple 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, the browser will automatically add blank lines before and after the paragraph.
Of course, even if you forget to use the closing tag, most browsers will display HTML:
<p>This is the first paragraph <p>This is the second paragraphTest to see <‹/›
The above example will work in most browsers, but do not use this method. Forgetting to use the closing tag can cause unpredictable errors, resulting in misplaced page content and affecting page layout, etc.
Note: Do not forget to close the tag
If you just want to break text content, not a new paragraph, use <br>or<br /> Tags for line breaks:
<p>This is a<br>normal line break in a paragraph<br>Here the effect of line breaks is demonstrated</p>Test to see <‹/›
The <br /> element is an empty HTML element. Since the closing tag has no meaning, it does not have an end tag
We cannot determine the exact effect of HTML being displayed. 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 removes 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 HTML code are also displayed as one space.
(This example demonstrates some possible formatting issues that may be encountered with HTML).
Параграфы HTML
How to display HTML paragraphs in a browser.
HTML line breaks
Using line breaks in an HTML document.
Typing a poem in HTML
When displaying HTML code, the browser automatically omits extra whitespace characters, spaces, and line breaks from the source code).
More paragraphs
DEFAULT BEHAVIOR OF THE PARAGRAPH
Руководство по тегам HTML предоставляет дополнительную информацию о элементах HTML и их атрибутах.
Тег | Описание |
---|---|
<p> | Определение абзаца |
<br> | Вставка одной отступа (ENTER) |