After reading all the answers here, and seeing the complexity described, I set upon a small diversion for experimenting with HR. And, the conclusion is that you can throw out most of the monkeypatched CSS you wrote, read this small primer and just use these two lines of pure CSS:
hr {
border-style: solid;
border-color: cornflowerblue; /* or whatever */
}
That is ALL you need to style your HRs.
height
, width
, background-color
, color
, etc. involved.Just bulletproof colourful HRs. It's that simpleTM.
Bonus: To give the HR some height H
, just set the border-width
as H/2
.