How to Use HTML Color Properties

HTML COLOR Properties

While Using HTML tags when we stylize them we have to use color properties, because the default color of fore-color in HTML is black and background color is white.

So there are three types and methods to define the colors properties in HTML and CSS.

  • Plain color name(English)
  • RGB();
  • Hexadecimal Colors

First, take a look at plane colors its means the normal names for colors that we use in our daily life like white, blue, red, orange, cyan etc.

Mostly colors are used with HTML properties that are bg-color for background color only used in body tag and color for foreground or text color.

Color Properties using Plain Color Name

Background-color set by using red

RGB( , ,) Color Properties

RGB means red blue green. This is the best way to define color properties in HTML.

All the colors are made of these three color and HTML use a function RGB() which take three parameters first one is red then blue and then green. The value of arguments is 0-255. Like if the color is RGB(255,255,0) then its mean red=255 that is the hot bold red and last point in dark red same for green=255 and this time blue is 0 so its end light green color.

 

Hexadecimal Color Properties

Hexadecimal color properties work on the same pattern like in RGB() red green blue.

#RGB

Or

#RRGGBB

As they are hexadecimal no’s so they take values from 0-F.

For example #0000FF is blue coz both red and blue is 0.

You can also get color from input type color it returns color hexadecimal value.

Check the colors code by running following code.

HTML Color Picker:

W3 Schools HTML Color Picker

See List of HTML hexadecimal colors