<hr> Tag in HTML

The <hr> tag in HTML is used to represent a thematic break or horizontal rule in a webpage. It is typically used to separate sections of content, making the page more visually appealing and easier to read. The tag creates a horizontal line that spans the width of the container.

Key Points on <hr> Tag:

Syntax of <hr> Tag:

Syntax Example

<hr>

Example of <hr> Tag in HTML:

This example demonstrates how to use the <hr> tag to separate two sections of content.

Code Example


        <h1>Section 1</h1>
        <p>This is the first section of content.</p>
        
        <hr>
        
        <h1>Section 2</h1>
        <p>This is the second section of content.</p>
                

Output

Section 1

This is the first section of content.

Section 2

This is the second section of content.

The <hr> tag is often used to improve the visual organization of a webpage. While it does not carry any semantic meaning, it helps in breaking up content into distinct parts. You can also use CSS to style the horizontal line, such as changing its thickness, color, and style (dashed, dotted, etc.).