Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my font color setting not working?

Tags:

html

css

fonts

I've tried this:

#ambrosia h3
{
    font: 12px/18px Arial,Verdana,sans-serif;
    font-color: red;
    font-weight: bold;
}

and this:

#ambrosia h3
{
    font: 12px/18px Arial,Verdana,sans-serif;
    color: red;
    font-weight: bold;
}

but I still end up with a gray font on my H3 text.

Why?

like image 646
Tree Avatar asked Feb 25 '23 11:02

Tree


2 Answers

Either you have another color set for the id #ambrosia and that is taking precedence over the generic selector, or you have another tag inside the h3 which has a color assigned to it.

Or, in your html you have the #ambrosia applied to the h3 tag, but in your css, you have specified an h3 element which is inside an #ambrosia element. If you are wanting to use <h3 id="ambrosia">, your css should be

h3#ambrosia { color: red; }
like image 62
JakeParis Avatar answered Mar 12 '23 11:03

JakeParis


You likely have other CSS that has a more specific selector that's giving your <h3> that font color, identifying that selector and/or posting your markup would help us provide a more specific selector that would override the font color.

like image 23
Nick Craver Avatar answered Mar 12 '23 12:03

Nick Craver