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.
0 Comments
That's all there was to HTML tutorials Did we miss something? Les us know in the comments section below. We'll be adding more tutorials on html introduction pretty soon, so stay tooned! :)