hr css color 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: html horizontal line style

<!-- 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">

Example 4: custom hr in css

<hr class="style-two">

/* Inset */

hr.style-two {
border: 0;
height: 0;
border-top: 1px solid rgba(0, 0, 0, 0.1);
border-bottom: 1px solid rgba(255, 255, 255, 0.3);
}

Tags:

Html Example