change color of hr in html code example
Example 1: css hr color
hr { border: 0; border-top: 1px solid #dee2e6; }
Example 2: add color to hr tag
<style>
hr.new1 {
border-top: 1px solid red;
}
hr.new2 {
border-top: 1px dashed red;
}
hr.new3 {
border-top: 1px dotted red;
}
hr.new4 {
border: 1px solid red;
}
hr.new5 {
border: 10px solid green;
border-radius: 5px;
}
</style>
<h2>Style HR</h2>
<p>Default:</p>
<hr>
<p>Different styles of HR:</p>
<hr class="new1">
<hr class="new2">
<hr class="new3">
<hr class="new4">
<hr class="new5">