Skip to main content

An <hr> element's color comes from its border-color

I tried setting background-color and was surprised to see no <hr /> color change.

Then I tried color — same result.

Then I found html - Changing the color of an hr element - Stack Overflow, where I learned that border-color is what works

hr {
  border-style: solid;
  border-color: fuchsia; /* or whatever */
}