Horizontal line in HTML

The <hr>tag is used for creating a Horizontal line. This is also called Horizontal rule in HTML.
We can change the line color, using color attribute.
We can change the default line size using size attribute.
We can change the default width using width attribute.


<!DOCTYPE html>
<title>Horizontal line in HTML</title>

Simple Line
Line with changed color.
<hr color="blue">
Line with changed size.
<hr size="10px">
Line with changed width.
<hr width="50%">
Line with changed width, color, size.
<hr width="80%" color="green" size="10px">

Output of this code will look like this: