color hr html
snippet in html

how to change the color of the hr tag in html

user5915

<style>       
    hr{
        height: 1px;
        background-color: #ccc;
        border: none;
    }
</style>

html horizontal line style

user9789

<!-- HTML -->

<!-- You can change the style of the horizontal line like this: --> 

<hr style="width:50%", size="3", color=black>  


<!-- Or like this: -->

<hr style="height:2px; width:50%; border-width:0; color:red; background-color:red">

color hr html

user5828


<!-- Note: cannot use color on this case, use border to style or <hr /> -->
<style>
hr.new3 {
  border: 1px solid blue;
}
</style>

<hr class="new3">