Site icon Tutorial

HTML Colors

HTML Colors

Colors are used to add look and feel to a web page. They are specified for the whole web page in the <body> tag or in individual tags to color them.

The <body> tag uses following attributes to set different colors

Now CSS is used to customize the color instead of above attributes.

Color Coding Methods

HTML uses three methods to identify colors in a web page and which are

Color Names – A color name is given to different colors and 16 basic color names are listed and standardized by W3C even though there are over 200 different color names. Standard 16 Colors are Black, Gray, Silver, White, Yellow, Lime, Aqua, Fuchsia, Red, Green, Blue, Purple, Maroon, Olive, Navy and Teal

Hex Codes – It uses a hexadecimal which is a 6 digit, representing a color. The first two digits indicate a red (RR) value, the next is for a green value (GG), and the last for blue value(BB). Various graphics software gives a hexadecimal value like Adobe Photoshop, Jasc Paintshop Pro.

Hexadecimal code is preceded by a hash sign (#) some examples are

Black – #000000, Red – #FF0000, Green – #00FF00, Blue – #0000FF and white – #FFFFFF

RGB Values – It uses the rgb( ) property by taking three values, one each for red, green, and blue. The value for each can be an number between 0 and 255 or a percentage. But all browsers does not support it so it is not widespread. Few examples are

Black – rgb(0,0,0), Red – rgb(255,0,0), Green – rgb(0,255,0), Blue – rgb(0,0, 255) and white – rgb(255,255,255)

Apply for HTML5 Certification Now!!

http://www.vskills.in/certification/Certified-HTML5-Developer

Back to Tutorial

Exit mobile version