can you change the color of a hr in html code example
Example 1: css hr color
hr { border: 0; border-top: 1px solid #dee2e6; }
Example 2: how to change the color of the hr tag in html
<style>
hr{
height: 1px;
background-color: #ccc;
border: none;
}
</style>
Example 3: 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">