What is horizontal rule in HTML Page?


The <hr> tag defines a break in an HTML page, or it is used to separate content in an HTML page using a horizontal line and is most often displayed as a horizontal rule.

The <hr> tag defines a break with the horizontal line in an HTML page. The <hr> tag is an empty element. It only has an opening tag i.e, <hr>.

Syntax

Following is the syntax for the <hr> tag.

<hr>...

Example

Following is the example program, which uses <hr> tag to separate content on the web page.

<!DOCTYPE html> <html> <body> <h3>LOK SABHA</h3> <p>Lok Sabha is composed of representatives of the people chosen by direct election.<br> The maximum strength of the House of the Constitution is 552, <br> which is made up by election of upto 530 members to represent the States,<br> upto 20 members to represent the Union Territories and not more than two members of the<br> Anglo-Indian Community to be nominated by the Hon'ble President.</p> <hr> <p> After coming into effect of The Constitution Act, 2019<br> the provision of special representation <br>of the Anglo-Indian community in the House of the People by nomination has not been extended further.</p> <hr> <p>The total elective membership is distributed among the States in such a way<br> that the ratio between the number of seats allotted to each State and the population of the State is,<br>so far as practicable, the same for all States.</p> <hr> </body> </html>

We can also add style to the hr tag.

Example

Following is the example program to add style to the <hr> tag.

<!DOCTYPE html> <html> <body> <h3>LOK SABHA</h3> <p>Lok Sabha is composed of representatives of the people chosen by direct election. <br> The maximum strength of the House of the Constitution is 552,<br> which is made up by election of upto 530 members to represent the States, <br> upto 20 members to represent the Union Territories and not more than two members of the<br> Anglo-Indian Community to be nominated by the Hon'ble President.</p> <hr style="height:10px;"> </body> </html>

Example

Following is the example program to add style to the <hr> tag.

<!DOCTYPE html> <html> <body> <h3>LOK SABHA</h3> <p>Lok Sabha is composed of representatives of the people chosen by direct election. <br> The maximum strength of the House of the Constitution is 552,<br> which is made up by election of upto 530 members to represent the States,<br> upto 20 members to represent the Union Territories and not more than two members of the<br> Anglo-Indian Community to be nominated by the Hon'ble President.</p> <hr style="height:8px;background-color:gray"> </body> </html>

Updated on: 21-Nov-2023

1K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements