HTML paragraph


Release date:2024-02-02 Update date:2024-02-24 Editor:admin View counts:62

Label:

HTML paragraph

HTML can split a document into paragraphs.

HTML paragraph

The paragraph is through the <p> defined by the label.

Example

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

Note: the browser automatically adds 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 it. Forgettingto use the closing tag can produce unexpected results and errors.

Note: the closing tag is not allowed to be omitted in future versions of HTML.

HTML wrapping

If you want to wrap a new line without generating a new paragraph, use the <br> label:

Example

<p>This paragraph demonstrates the effect of branching</p>

<br/> element is an empty HTML element. Because closing the tag does notmake any sense, it does not end the tag.

HTML output-use reminder

We are not sure exactly how HTML is displayed. The size of the screen and the adjustment of the window can lead to different results.

With HTML, you cannot change the effect of the output by adding extra spacesor line breaks to the HTML code.

When the page is displayed, the browser removes excess spaces and blank lines from the source code. All consecutive spaces or blank lines are counted as a space. It is important to note that all consecutive blank lines(newlines) in the HTML code are also displayed as a space.

(this example demonstrates some problems with HTML formatting.)

Image0

An example of this site

HTML paragraph

How to display HTML paragraphs in a browser.

New line

Use line breaks in HTML documents.

Typesetting a Tang poem in HTML code

When the browser displays HTML, it will omit the extra white space characters (spaces or carriage returns, etc.) in the source code.

More Instance

More paragraphs

The default behavior of the paragraph.

HTML tag reference manual

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

Label

Description

< p >

Define a paragraph

< br >

Insert a single line break (line wrap)

Powered by TorCMS (https://github.com/bukun/TorCMS).