Home  >  Article  >  Web Front-end  >  Functions of HTML paragraphs

Functions of HTML paragraphs

(*-*)浩
(*-*)浩Original
2019-08-23 15:20:032015browse

Functions of HTML paragraphs

You can divide the HTML document into several paragraphs. (Recommended learning: HTML introductory tutorial)

HTML Paragraph

Paragraphs are defined through the

tag

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

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

is a block-level element)

Tip:It is a bad habit to use empty paragraph tags

to insert a blank line. Replace it with the
tag! (But don’t use the
tag to create a list. Don’t worry, you’ll learn about HTML lists later.)

HTML Line Wrapping

If you want line breaks (new lines) without producing a new paragraph, use the
tag:

<p>This is<br />a para<br />graph with line breaks</p>


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


or

You may find that
is similar to
.

In XHTML, XML, and future versions of HTML, HTML elements without a closing tag (closing tag) are not allowed.

Even if
displays correctly in all browsers, using
is a longer-term guarantee.

The above is the detailed content of Functions of 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