Colour a hr tag

Need a little help with a hr tag, I have tried to colour the background but I can't seem to find the right code can anyone help?
 
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;
}
 
What a boob I didn't think of looking in the current CSS, cheers for that I will have a look and see what's what. thanks for the quick response
 
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:
 
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.
 
I don't want to be over writing anything especially when the code is already there, I want to keep everything as simple and as neat as possible
 
Back
Top