To change the color of an ‘hr’ tag with CSS, you can use the ‘border-color’ property. Here is an example:

hr {
    border-color: red;
}

This will change the color of all hr tags on the page to red.

You can also use the ‘background-color’ property to change the color of the background of the hr tag.

hr {
    background-color: red;
}

It should be noted that if you use this method it will change the color of the whole hr and not only the border of it.

You can also target a specific ‘hr’ tag by giving it an id or class and then using the id or class to target it in your CSS.

<hr id="my-hr" />
#my-hr {
    border-color: red;
}
<hr class="my-hr" />
.my-hr {
    border-color: red;
}

This way you can apply different color to different hr tags on the same page.

Also Read:

Categorized in: