Home  >  Article  >  Web Front-end  >  A detailed introduction to HTML paragraphs

A detailed introduction to HTML paragraphs

高洛峰
高洛峰Original
2017-03-22 14:22:061586browse

HTML can divide the document into several paragraphs.


HTML paragraph

Paragraphs are defined using the

tag.

This is a paragraph


##

This is another paragraph



Note: The browser will automatically add blank lines before and after the paragraph. (

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:


This is a paragraph

This is another paragraph

The example above will work fine in most browsers, but don't rely on this approach. Forgetting to use closing tags can produce unexpected results and errors.

Note: In future versions of HTML, omitting the closing tag will not be allowed.


HTML line wrapping

If you wish to wrap (new line) without creating a new paragraph, use the
tag:

This is
a para
graph with line breaks


The
element is an empty HTML element. Since a closing tag doesn't make any sense, it doesn't have a closing tag.


HTML output - usage reminder

We are unable to determine the exact effect of the HTML being displayed. The size of the screen, as well as adjustments to the window, may lead to different results.

With HTML, you cannot change the output by adding extra spaces or line breaks to the HTML code.

When displaying the page, the browser removes extra spaces and blank lines from the source code. All consecutive spaces or empty lines are counted as one space. Note that all consecutive empty lines (newlines) in HTML code are also displayed as a single space.

The above is the detailed content of A detailed introduction to HTML paragraphs. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn