What is HTML Horizontal Rule?
In HTML, <hr>
(horizontal rule) is a simple horizontal line that appears in different sections of webpage.
The <hr>
element is used to create horizontal line in the webpage content.
It is often used to separate sections of webpage content.
Example of Creating HTML Horizontal Rule
Add an <hr>
element between the sections where you want to display the horizontal line.
Look at the following example where <h1>
and <p>
elements are separated by a horizontal line.
Example of Horizontal Rule
Output of the above example
Example of Horizontal Rule in HTML
The above line is a horizontal rule
You can increase the height of horizontal line and change the color of the line.
Following example illustrates the use of CSS height and background-color properties: