HTML Colors

HTML Tutorial

Color Names

Completed

In HTML, a color will be indicated using a color name:

Example

Color Name
 Red
 Orange
 Yellow
 Cyan
 Blue

Try it Yourself

HTML has the ability to support 140 standard color names.

HTML Colors

Completed

Example

Color RGB
  rgb(255,0,0)
  rgb(255,255,0)
  rgb(0,255,0)
  rgb(0,255,255)
  rgb(0,0,255)

Try it Yourself

HTML Colors

Completed

Shades of gray are usually mentioned by equal values with respect to all the 3 light sources:

Example

Color RGB
  rgb(0,0,0)
  rgb(90,90,90)
  rgb(128,128,128)
  rgb(200,200,200)
  rgb(255,255,255)

Try it Yourself

HEX Value

Completed

In HTML, a color can also be mentioned by a hexadecimal value in the form: #RRGGBB, where RR (red), GG (green) and BB (blue) are found to be hexadecimal values between 00 and FF (same as decimal 0-255).

For example, #FF0000 is being shown as red, as red is set to have its highest value (FF) and the others are set to have the lowest value (00).

Example

Color HEX
  #FF0000
  #FFFF00
  #00FF00
  #00FFFF
  #0000FF

Try it Yourself

Shades of gray are usually mentioned by equal values with respect to all the 3 light sources:

HTML Colors

Completed

Example

Color HEX
  #000000
  #404040
  #808080
  #CCCCCC
  #FFFFFF

Try it Yourself