The <hr> tag in HTML adds a line that separates content in an HTML document. A thematic break is defined by the <hr> tag in HTML5. It has no end tag.
Let us now see an example to implement the <hr> tag −
Example
<!DOCTYPE html> <html> <head> <title>Document Title</title> </head> <body> <h1>Products</h1> <p>Here are the products −</p> <h2>Clothing</h2> <p>Clothing includes T-Shirts, Shirts, Jeans, Trousers and Hoodie.</p> <hr> <h2>Electronics</h2> <p>Electronics includes Mobile, Mobile Accessories,Laptops, Desktop systems, etc.</p> </body> </html>
Output
In the above example, we have first set a section −
<h2>Clothing</h2><p></p> <p>Clothing includes T-Shirts, Shirts, Jeans, Trousers and Hoodie.</p>
After that, we have used the <hr> tag to separate the above content with the below one −
<hr> <h2>Electronics</h2> <p>Electronics includes Mobile, Mobile Accessories,Laptops, Desktop systems, etc.</p>