HTML hr tag

HTML hr is an HTML tag that allows drawing a horizontal line. In HTML, tags are usually opened and closed but <hr> tag does not need to be closed.

So, it is not used as <hr></hr>

Features

  • hr tag has features like width, color, and size.
  • We can determine width, color, and size.
  • However, these features are not supported in HTML5. So, if we want to shape the line, we need to use CSS.
  • In the example below, a horizontal line is drawn between two texts using the hr tag.
<hr width="100%" color="red" size="2">

In the example below, a horizontal line is drawn between two texts using the hr tag.

<p>Text</p>
<hr>
<p>Text</p>

Text


Text

459 Views
70610cookie-checkHTML hr tag

Leave a Reply

Your email address will not be published. Required fields are marked *