Why doesn't font color adjustment work?

I 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 get a gray font in the H3 text.

Why?

+3
source share
4 answers

You probably have other CSS that has a more specific selector that gives your <h3>font color defining that selector and / or the layout of your markup will help us provide a more specific selector that would override the font color.

+1
source

Either you have another set of colors for id #ambrosiathat takes precedence over the universal selector, or you have another tag inside h3 that has a color assigned to it.

html #ambrosia, h3, css h3, #ambrosia. <h3 id="ambrosia">, css

h3#ambrosia { color: red; }
+4

You must use the Chrome Inspect Element option. Right-click on the row and select "Test Element" and it will show you the evolution path of the CSS of your element.

+1
source

color: red; The syntax is correct. however, it is possible that you have other styles in the css file that are conflicting.

you can try using the firefox plugin firefox. it will allow you to select an element and see what style is applied to the element, and if your class is overridden

0
source

Source: https://habr.com/ru/post/1783130/


All Articles