Google News
logo
Text color using Hex color codes
The most common way of coloring HTML text is by using hexadecimal color codes (Hex code for short). Simply add a style attribute to the text element you want to color – a paragraph in the example below – and use the color property with your Hex code.
Example Program
<html>
   <head>
<title>HTML Colors</title>
   </head>
   <body>
<p style="color:#FF0000";>Red paragraph text</p>
   </body>
<html>
Color Name HEX Color
Black  #000000  
Gray  #808080  
Silver  #C0C0C0  
White  #FFFFFF  
Yellow  #FFFF00  
Lime  #00FF00  
Green  #008000  
Aqua  #00FFFF  
Fuchsia  #FF00FF  
Red  #FF0000  
Blue  #0000FF  
Purple  #800080  
Maroon  #800000  
Olive  #808000  
Navy  #000080  
Teal  #008080  
Text color using HTML color names
Another way to color your website's text is by using an HTML color name. The HTML code is similar, just replace the Hex code from the previous step with the name of the color you want to use (red in our example). 
Example Program
<html>
   <head>
<title>HTML Colors</title>
   </head>
   <body>
     <p style="color:red;">Red paragraph text</p>
   </body>
<html>
Text color using RGB color values
Using RGB values is all the rage these days, but it's just as easy as Hex codes or color names. Insert your RGB values within the rgb() parameter following the color property. 
Example Program
<html>
   <head>
<title>HTML Colors</title>
   </head>
   <body>
     <p style="color:rgb(255,0,0);">Red paragraph text</p>
   </body>
<html>
ColorColor RGB
 rgb(0,0,0)
 rgb(192,192,192)
 rgb(255,255,255)
 rgb(255,0,0)
 rgb(0,255,0)
 rgb(0,0,255)
 rgb(255,255,0)
 rgb(0,255,255)
 rgb(255,0,255)