Html horizontal rule



HTML Horizontal Rule:


HTML Horizontal Rule renders a line in a web browser. It is an empty element.


The <hr /> element defines an HTML Horizontal Rule.


Look at the example below, to see how it works.


Example:


<p> This is a paragraph. </p>

<hr />

<p> This is a paragraph. </p>


Output:


This is a paragraph.

This is a paragraph.


Styling and Changing the Color of HTML Horizontal Rules:


 In the example below you will learn how to style

HTML Horizontal Rules by changing its width and height.


To change its color we need to use the color attribute.


Example:


<!-- width -->

<hr style="width: 50%" color="black"

<!-- height -->

<hr style="height: 40px" color="black

<!-- color --> <hr color="gold" />


Output:



✔ You can style your own HTML Horizontal Rules depending on your needs.


❤Thanks for visiting❤