HTML hr tag
hr tag in HTML:
In HTML, the "hr" tag is employed to create a horizontal rule- it is an invisible line or a divider that helps distinguish content on a website.
This is most frequently achieved through images and other contextual elements such as graphics and charts.
Example
"hr tag" is just a kind of a digital line or separator (highlighted) This line is purposed to be oblique, horizontally splitting the content visually.
Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome to Our Website</title>
<style>
hr {
margin-top: 20px;
border: 1px solid #bdc3c7; /* Light gray color for horizontal rule */
}
</style>
</head>
<body>
<h1>Welcome to Our Website</h1>
<p>We offer a wide range of products to suit your needs.</p>
<hr>
<p>Contact us today to learn more about our services.</p>
</body>
</html>
Try it Yourself »