HTML horizontal rules, also known as horizontal lines, are used to create a visual separation between different sections of content on a webpage. They are represented by the <hr> tag.
Using the hr tag is very simple, as it requires only one line of code:
<hr>
The <hr> tag does not have any closing tag, it is a self-closing tag. It does not require any attributes, and it does not have any specific properties or styling options.
When rendered by a browser, the <hr> tag creates a horizontal line that spans the full width of its container element, like a div or a section. You can use it to separate different parts of the content, like different sections of an article, different elements in a form, or between different sections of a webpage.
You can also use CSS to style the <hr> tag, such as changing its color, width, and height.
The following are some common attributes used with the
<hr align="center" width="70%" size="3" color="#8080ff">
<html> <head> <title>Horizontal Rule</title> </head> <body> <h1>Heading 1</h1> <hr> <h2>Heading 2</h2> <hr align="center" width="70%" size="3" color="#8080ff"> </body> </html>To download raw file Click Here
Between the two headings, there is a horizontal rule represented by the <hr> tag. This creates a horizontal line on the webpage that spans the full width of its container element, in this case the <body> element. It separates the two headings and helps to visually break up the content on the webpage, making it easier to read and understand.
A second horizontal rule <hr> tag having the following attributes:
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions