How To

How to Set Text Color in HTML

By eHow Internet Editor
Rate: (2 Ratings)

It has always been a practice in writing to emphasize importance with visual cues. Fortunately, the HTML environment provides many ways to do so, including colored text. This article describes how to color text in any Web page.

Difficulty: Easy
Instructions

Things You'll Need:

  • Text or HTML editor

    Set Text Color Using the FONT tag

  1. Step 1

    Click the mouse in front of the content that you want to apply color to.

  2. Step 2

    Type in the following opening HTML tag:

    "Colorname" is the name of the color that you want to use. Here is a quick list of common color names their hexadecimal equivalents to choose from:
    aqua #00FFFF
    black #000000
    blue #0000FF
    fuchsia #FF00FF
    gray #808080
    green #008000
    lime #00FF00
    maroon #800000
    navy #000080
    olive #808000
    purple #800080
    red #FF0000
    silver #C0C0C0
    teal #008080
    white #FFFFFF
    yellow #FFFF00
    . Example: I am red.

  3. Step 3

    Click the mouse behind the content that you're editing. When you see an I-beam, you're ready to insert the ending HTML tag of colored text.

  4. Step 4

    Type in the following closing HTML tag:

  5. Set Text Color Using CSS

  6. Step 1

    Add the following attribute to the element, such as or

    , containing the text whose font you want to change.
    style="color: red;"

  7. Step 2

    Replace "red" with the number or name of the color you want.

  8. Step 3

    Give the containing element a class attribute, and define CSS properties for that class in the