In HTML, the <hr>
tag is used to create a thematic break or horizontal line, typically to visually separate content sections. The <hr>
tag doesn't have a closing tag because it's a self-closing tag. You can also use the <hr>
tag to indicate a thematic change in your content. Here's how you use it:
<!DOCTYPE html>
<html>
<head>
<title>Horizontal Line Example</title>
</head>
<body>
<h1>Section 1</h1>
<p>This is the content of section 1.</p>
<hr> <!-- This creates a horizontal line -->
<h1>Section 2</h1>
<p>This is the content of section 2.</p>
</body>
</html>
<hr>
tag is placed between the two sections to indicate a thematic change in the content.<hr>
tag to customize its appearance, such as color, size, and alignment.For example:
<hr color="blue" size="2" align="center">
This version of the <hr>
tag has the following attributes:
Remember that the exact appearance of the <hr>
element can vary depending on the browser and the default CSS styles applied by your website's stylesheet. If you want more precise control over the styling of your horizontal lines, you may consider using CSS.
Thank You