Tutorials

KodeKite Tools

HTML
Flexbox
SVG
Canvas
HTML Tutorial

More


HTML Colors
Colors

HTML Colors are used to decorate HTML elements or assign a specific color to specific element. Colors are of following types


  • Color names
  • RGB Colors
  • HEX Colors
Color Names

Colors can be assigned to HTML elements by using color names like red, green, blue etc.

Syntax

color:ColorName;


You can use color names to apply color to any html element.


Example

Heading 1


Named Colors List
Red
Green
Blue
Orange
Yellow
Cyan
Lime
Purple
Brown
Gray
Deeppink
Black
White


For more colors visit CSS Colors

You can use any of above color name using CSS any where within an HTML document.

RGB Colors

Colors can be assigned to HTML elements by using RGB values like R for red (255,0,0), G for green (0,255,0),and B for blue (0,0,255) so its known as RGB colors etc.

Syntax

color:rgb(R,G,B);


You can use rgb colors to apply color to any html element.


Example

Heading 1


RGB Colors List
rgb(255,0,0)
rgb(0,128,0)
rgb(0,0,255)
rgb(255,165,0)
rgb(255,255,0)
rgb(0,255,255)
rgb(0,255,0)
rgb(128,0,128)
rgb(156,42,42)
rgb(128,128,128)
rgb(255,20,147)
rgb(0,0,0)
rgb(255,255,255)


For more colors visit CSS Colors

You can use any of above rgb color using CSS any where within an HTML document.

Hexa Colors

Colors can be assigned to HTML elements by using HEX values like red #FF0000, green #00FF00, and blue #0000FF. HEX values are six characters and can be shorten to three character hex values like red #F00, green #0F0, and blue #00F. You can write uppercase or lowercase hex color values.

Syntax

color:#RRGGBB;


You can use hex colors to apply color to any html element.


Example

Heading 1


Hexa Colors List
#FF0000
#008000
#0000FF
#FFA500
#FFFF00
#00FFFF
#00FF00
#800080
#A52A2A
#808080
#FF1493
#000000
#FFFFFF


For more colors visit CSS Colors

You can use any of above hex color using CSS any where within an HTML document.

Colors are basic part of designing and developement.


Practice Task

Open notepad or any other text editor, follow the following points.


  • Create any HTML element
  • Assign any text or content to it
  • Give any color to element from above colors in hex values
  • Use CSS color property for assigning color

save file with name task.html or task.htm and then open it using any browser and see results.


Solution

I am heading 3


Don't forget colors are the basic need of designing and developement becuase they affects human nature and behaviour.