HTML Font Color Codes


When formatting text in HTML, using HTML font color codes is important for the aesthetics of your web page. There are various ways to turn your text into vibrant letters; which one you use depends on how comfortable you are with the technique. Some programmers prefer to write the code manually for a web page, so knowing HTML font color codes is beneficial for them. Other programmers use WYSIWYG web building software. While such programs insert the color codes automatically, it can save you some time if you memorize the basic colors.

Font Color Designations

To give text color, you use the font attribute in your coding. One way to designate color is to write out the color name, like "black" or "white." For example, the font attribute written out looks like:

<font color="black">Place text here.</font>

You do this each time you want to change the font color. One advantage to using the color name is that it's easier to remember the colors. If you just need to use the simple colors, then all you need to type is "red", "blue", "yellow", "orange", "black", "white", "purple" or "green."

Other colors that you can try include:

  • Limegreen
  • Blueviolet
  • Lightgoldenrodyellow
  • Hotpink
  • Darkslateblue
  • Darkseagreen
  • Mistyrose

Writing the full color name works in HTML and Javascript code as well as CSS creating. Note the spectrum of full color names is limited to 140 colors. For a chart of all the available colors you can use with this method, go to HTML Color Chart.


For more color variety, use hexadecimal numbers in the font attribute. Hexadecimal is a six-digit code that tells the web browser what color to create the text. In a hexadecimal number, the numbers 0 through 9 and letters A through F. Using a mixture of those characters, you can create 16 million color combinations.

Here are a few examples:

  • 000000 = black
  • FFFFFF = white
  • FF0000 = red
  • 008000 = green

The font attribute coding will look like this: <font color=#FFFFFF>White text is shown with the #FFFFFF hexadecimal code.</font>

Body Text

If the text on a web page doesn't change, but you want the text a certain color, you can specify the color in the "<body>" tag. The color you chose will be the default color unless you add another tag elsewhere in your coding. The coding occurs at the top of your document:

<body text="Blue">

Popular Color Codes

Here are 16 common colors and their hexadecimal equivalents:

  • Red, #FF0000
  • White, #FFFFFF
  • Blue, #0000FF
  • Gray, #808080
  • Orange, #FF8040
  • Brown, #804000
  • Yellow, #FFFF00
  • Purple, #800080
  • Turquoise, #00FFFF
  • Green, #808000
  • Pink, #FF00FF
  • Dark Blue, #0000A0
  • Light Grey, #C0C0C0
  • Black, #000000
  • Light Purple, #FF0080
  • Grass Green, #408080

For a larger list of hexadecimal codes and their full names, visit HTML Color Codes.

Additional Uses

Besides the font attribute, you can use the HTML font color codes in the following additional ways in the style attribute for various codes:

  • Body Style. Set the background color by adding a style="background:#000000 attribute.
  • Table Color. A table can have its own background color by adding a background:#000000 to the style attribute.
  • Link Color. Tired of the boring blue color of a link? Change it by add a different color. The link code is <a style="color:#000000">.

HTML Hexadecimal Code Meaning

All the hexadecimal numbers are represented by the three main colors of red, green and blue. In the six digit combination, the first two characters indicate how much red you desire. The second set of numbers indicate how much green you want and the last set is how much blue is included. In all the cases, "00" is the lightest and "FF" is the most intense. Using "FF" in any of the sets and "00" in the other two gives you the pure colors of red, green and blue respectively.If you don't want to memorize codes, then the best thing is to play around with different combinations to find the best look for your website.

Was this page useful?
Related & Popular
HTML Font Color Codes