HTML Tutorial
The <hr> tag is used to insert a horizontal line into a web page. It helps to visually separate sections of content and improve readability.
<hr> <!-- Default horizontal line -->
<hr width="500px"> <!-- Horizontal line with width of 500 pixels -->
<hr size="5"> <!-- Horizontal line with height of 5 pixels -->
<hr color="red"> <!-- Horizontal line in red color -->
<hr align="center"> <!-- Center-aligned horizontal line -->
<hr> tag where you want a horizontal line to appear.width, size, color, and align attributes to customize the line.Example:
<!DOCTYPE html>
<html>
<head>
<title>Exploring the <hr> Tag</title>
</head>
<body>
<h1>Section 1</h1>
<hr>
<h1>Section 2</h1>
</body>
</html>
This example creates two sections separated by a horizontal line using the <hr> tag. The horizontal line has a default width and size, and it is left-aligned.