Last Updated on
In CSS, font color is given by using css "color" Property, background color is given using "background-color" property and border color is given using "border-color" property. Basically there are three major colors, Red, Green, and Blue. Rest all colors are a combination of these three colors. RGB Colors are basically Screen Colors. However for printing purpose, we use CMYK
Hexadecimal Color code
CSS include total 16,777,216 ( 1 Crore 67 Lakhs ) or 16 Million colours.
However 17 colors are known by their name. These popular colors are
<p style="color:red"> Color Red </p>
<p style="color:blue"> Color Blue </p>
<p style="color:green"> Color Green </p>
<p style="color:yellow"> Color Yellow </p>
We can also write color's value using HEXADECIMAL COLOR CODES.
Hexadecimal is basically a 16 base number system where we use 16 different values and mix them to write a color code.
In Hexadecimal color coding, we use:
Minimum value is 0, and maximum is f.
There are total six digits. First two represent red, next two represents green and last two represents blue color.
|Color Name||Hexa Code||Hexa in short|
Rest all color are mixture of RGB Colors
<p style="color:#ff0000"> Color Red </p>
<p style="color:#0000ff"> Color Blue </p>
<p style="color:#00ff00"> Color Green </p>
<p style="color:#000000"> Color Black </p>
<p style="color:#ffffff"> Color White </p>
We can also write a color value using RGB Color Code( Red, Green, Blue) color value.
In RGB, we write a color using its value which lies in-between 0 and 255.
0 is minimum value and 255 is maximum.
|Color Name||Hexa Code||RGB Code|
<p style="color:rgb(255,0,0)"> Color Red </p>
<p style="color:rgb(0,255,0)"> Color Green </p>
<p style="color:rgb(0,0,255)"> Color Blue </p>
Earlier, when color monitors or 8-bit color graphics were popular, and High Resolution, HD, FHD and Ratina Based LCDs/LEDs were not in the market, Designers were asked to use only few major colors so that similar colors could be identified easily. The reason was CRT were based on light projection phenomenon. We can't view all colors on a CRT based Monitors.
There are total 216 colors in true web or Web Safe colors..
True Web Colors are written in hexa code, but only three place. Values are 0, 3, 6, 9, c, f
HTML Color Picker, or CSS Color Picker
This color picker will not work on Touch based devices, like smartphones and tablet
For CSS3 RGBA, HSL and HSLA colors, click below