" tag between the paragraphs that need to be separated to create a horizontal line."/> " tag between the paragraphs that need to be separated to create a horizontal line.">

Home  >  Article  >  Web Front-end  >  How to set hr in html

How to set hr in html

藏色散人
藏色散人Original
2021-03-31 17:06:417287browse

htmlHow to set hr: First create an HTML sample file; then enter some text content in the body; finally add the "


" tag between the paragraphs that need to be separated to create a horizontal line.

How to set hr in html

The operating environment of this tutorial: Windows7 system, HTML5&&CSS3 version, Dell G3 computer.


Definition and Usage

The


tag creates a horizontal line in an HTML page.

Horizontal rule (horizontal rule) can visually separate the document into various parts.

Differences between HTML and XHTML

In HTML, the


tag does not have a closing tag.

In XHTML,


must be closed correctly, such as
.

In HTML 4.01, all rendering attributes of the hr element are deprecated.

In XHTML 1.0 Strict DTD, all rendering attributes of the hr element are not supported.

Optional attributes

How to set hr in html

Example

Titles and paragraphs separated by horizontal lines:

<html>

<body>
<p>hr 标签定义水平线:</p>
<hr />
<p>这是段落。</p>
<hr />
<p>这是段落。</p>
<hr />
<p>这是段落。</p>
</body>
</html>

The effect is as follows:

How to set hr in html

Recommended learning: "HTML video tutorial""css video tutorial"

The above is the detailed content of How to set hr in html. 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
Previous article:what are html attributesNext article:what are html attributes