Ronald Dekker Ronald Dekker - 4 months ago 6
CSS Question

font color html inside tag don't change

I have a css what describe the h6 tag like this

h6{
font-family: 'Josefin Sans', sans-serif;
font-size: 10px;
text-align: center;
color: #0f7f7f7;
text-shadow: 1px 1px 1px rgba(0,0,0,0.6);}


In just 1 line in my page I want an exception so I did this:

<h6 font color="red">text here not in red <br>


But I can't find why it still keeps the color, what is defined in the CSS

Answer

First you have the wrong syntax for applying inline styles. (As posted by @grateful)

Second you maybe better set a class name and apply styles to this class name. For example:

CSS:

h6 {
    font-family: 'Josefin Sans', sans-serif;
    font-size: 10px;
    text-align: center;
    color: #0f7f7f7;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.6);
}

h6.important-note {
    color: red;
}

HTML:

<h6>A normal heading of size six.</h6>

<h6 class="important-note">A really important heading of size six.</h6>
Comments