HTML Horizontal Line

<hr> tag in HTML

The <hr> tag stands for Horizontal Rule.

The <hr> tag represents a division or break in the text.

This breaks can split the content into two fragments with different topics.

Browsers usually represent this break visually, through a horizontal line.

It does not have a closing tag.

Example

Try Yourself

attributes in <hr> tag

  • color
  • width - deprecated, but still supported by some browsers.
  • size - deprecated, but still supported by some browsers.
  • align - deprecated, but still supported by some browsers.
  • noshade - deprecated, but still supported by some browsers.

color attribute in <hr> tag

color attribute is used to give the color for the line created using the <hr> tag.

Example

Try Yourself

width attribute in <hr> tag

width attribute is used to set the line width.

Example

Try Yourself

The above example might not work in some browsers, because this attribute is deprecated


size attribute in <hr> tag

size attribute is used to set the line size.

Example

Try Yourself

The above example might not work in some browsers, because this attribute is deprecated


align attribute in <hr> tag

align attribute is used to set the lines position(left,right or center).

Its default position is center.

Example

Try Yourself

The above example might not work in some browsers, because this attribute is deprecated


noshade attribute in <hr> tag

noshade attribute is used to remove the shade from the line.

Example

Try Yourself

The above example might not work in some browsers, because this attribute is deprecated