davesite.com / webstation / html code tutorial
Help us out by taking a site survey.
Try our: CSS Tutorial, Web Design Tutorial
Click Here to Learn "Insider Secrets"
This great course helped me make more money online.

HTML Tutorial Chapters:


Using Hexadecimal Color Codes

The Hexadecimal Color Codes are used for many things in HTML.

Also, learn how to use Hexadecimal colors with CSS.

For Page Backgrounds: <body bgcolor="#hexdec">

For Text Colors: <font color="#hexdec">

For Page-Wide Link and Text Colors:

<body text="#hexdec" link="#hexdec" vlink="#hexdec" alink="#hexdec">
(where text is text color, link is non-visited link color, vlink is already-visited link color, and alink is the color a link turns at the second it is clicked)


There are 16.7 million different colors in the hexadecimal color system.
#000000 is black, and #FFFFFF is white.
Each of the 6 digits in the hexadecimal code is broken into 3 seperate groups...
  • #XXxxxx - Red Color Value
  • #xxXXxx - Green Color Value
  • #xxxxXX - Blue Color Value

Each digit is a value from 0 to F, in the hexadecimal system. The hexadecimal color system counts by 0 1 2 3 4 5 6 7 8 9 A B C D E F, with 0 being null value, and F being highest value.

So if the first two digits (red values) are full (FF) and the other four are null (00) the color will be red.

#FF0000 - AaBbCcDdEeFf1234567890Background #FF0000
If the first two are null (00), the third and fourth digit (green value) are full (FF), and the fifth and sixth digit are null (00), the color will be green.
#00FF00 - AaBbCcDdEeFf1234567890Background #00FF00
If the first four digits are null (00), and the fifth and sixth digit (blue value) are full (FF), the color will be blue.
#0000FF - AaBbCcDdEeFf1234567890Background #0000FF
Here is an example of the different shades of colors between black and white.
#000000 - AaBbCcDdEeFf1234567890Background #000000
#111111 - AaBbCcDdEeFf1234567890Background #111111
#222222 - AaBbCcDdEeFf1234567890Background #222222
#333333 - AaBbCcDdEeFf1234567890Background #333333
#444444 - AaBbCcDdEeFf1234567890Background #444444
#555555 - AaBbCcDdEeFf1234567890Background #555555
#666666 - AaBbCcDdEeFf1234567890Background #666666
#777777 - AaBbCcDdEeFf1234567890Background #777777
#888888 - AaBbCcDdEeFf1234567890Background #888888
#999999 - AaBbCcDdEeFf1234567890Background #999999
#AAAAAA - AaBbCcDdEeFf1234567890Background #AAAAAA
#BBBBBB - AaBbCcDdEeFf1234567890Background #BBBBBB
#CCCCCC - AaBbCcDdEeFf1234567890Background #CCCCCC
#DDDDDD - AaBbCcDdEeFf1234567890Background #DDDDDD
#EEEEEE - AaBbCcDdEeFf1234567890Background #EEEEEE
#FFFFFF - AaBbCcDdEeFf1234567890Background #FFFFFF
Here are some examples of mixed colors...
#FFFF00 - AaBbCcDdEeFf1234567890Background #FFFF00
#00FFFF - AaBbCcDdEeFf1234567890Background #00FFFF
#FF00FF - AaBbCcDdEeFf1234567890Background #FF00FF
#ABCDEF - AaBbCcDdEeFf1234567890Background #ABCDEF
#FEDCBA - AaBbCcDdEeFf1234567890Background #FEDCBA
#A1F4BB - AaBbCcDdEeFf1234567890Background #A1F4BB
Try mixing your own colors in your web pages until you find one you like.

Also, if you want your site to be the most compatible for varying monitor/lcd settings, learn about the 216 'web safe' (hexadecimal) colors.
Return to the Beginners HTML Tutorial!