• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Colour a hr tag


Paul Murray

Moderator
Staff member
#2
I believe it takes it's colour from the 'color' tag.


hr {
color:#000;
}

You can also use the background color tag too

hr {
background-color:#000;
}

If it's not changing color it may be inheriting it's color from the somewhere else. Adding !important before the semi colon should override it.

hr {
color:#000!important;
}
 

Corrosive

Well-Known Member
#4
Actually, color will change the text color only. You want to use background-color for that. Also 'color' isn't a tag it is a CSS attribute. It is important not to confuse matters. Tags are HTML.

Sorry to be a nerd :icon_wink:
 

Edge

Active Member
#7
Adding !important before the semi colon should override it.

hr {
color:#000!important;
}
Aside: It's usually better to make your css selector's more specific than use !important as it get's to be a bad habit. I'd only use it when overwriting an inline style that some plugin javascript has chucked in.