<hr>


HTML <hr> Tag

Instance

<!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>php中文网(php.cn)</title> 
</head>
<body>

<h1>HTML</h1>
<p>HTML 是用于描述 web 页面的一种语言。</p>

<hr>

<h1>CSS</h1>
<p>CSS 定义如何显示 HTML 元素。</p>

</body>
</html>

Run Example»

Click the "Run Instance" button to view the online instance


Browser support

1000.png

##All major browsers support the <hr> tag .


Tag definition and usage instructions

<hr> Tags define topic changes (such as topic changes) in HTML pages and are displayed as a horizontal line. The

<hr> element is used to separate content in an HTML page (or to define a variation).


Differences between HTML 4.01 and HTML5

In HTML5, <hr> defines the theme variation in the content and is displayed as a horizontal line.

In HTML 4.01, the <hr> tag appears only as a horizontal line.

In HTML 4.01, all layout attributes are deprecated. These attributes are no longer supported in HTML5. Use CSS to style the <hr> element.


Differences between HTML and XHTML

In HTML, the <hr> tag does not have a closing tag.

In XHTML, the <hr> tag must be closed correctly, such as <hr />.


Properties

PropertiesValueDescriptionalignleftnoshadenoshadesizewidth
center
​ right
HTML5 is not supported. HTML 4.01 is deprecated. Specifies the alignment of the <hr> element
HTML5 Not supported. HTML 4.01 is deprecated. Specifies that the color of the <hr> element is rendered as a solid color.
pixelsHTML5 Not supported. HTML 4.01 is deprecated. Specifies the height of the <hr> element.
pixels ​ %
HTML5 is not supported. HTML 4.01 is deprecated. Specifies the width of the <hr> element.


##Global attributes

<hr> tag supports global attributes of HTML.

Event attributes

<hr> tag supports HTML event attributes.