CSS Font Color

Here's an example of how to change the font color in CSS.

p {color: blue}

Here we are changing all paragraphs to appear in the color blue. Of course, you can use any color that you like and if you use one of the 16 predefined colors, you can just type in its name.

If you want to be more specific, you can type in the the hexadecimal value of the color that you want (be sure to also include the hash mark).

An alternate way to express the color in CSS is to use percentages.
Here's an example:

p {color: rgb(%40, 10%, 25%)}

Notice that where the percent signs are located. The first number is the amount of red that you want in your color. The second number is the amount of green in your color, and the third number is the amount of blue.

If you remember how to give names and identifiers to your tags and elements, you can see how they come into play here.
Lets say for example that you've given some of your p elements the tag name of, "super". Now to change the color of all those p elements that have a class name of "super", you would type:

p.super{color:blue}


Of if you given one of your p element the identifier, "super", then you would use the code:

p#{color:blue}

Next: CSS Font Family

Template Design | Elque 2007