HTML Paragraph
HTML can divide the document into several paragraphs.
HTML Paragraph
Paragraph is defined by the <p> tag.
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:
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:
<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.
(This example demonstrates some HTML formatting issues)
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) |