Color

In this chapter we will learn how to use the color property.

The color property describes the color of the text content.

You can find web colors with our Color Picker tool and in the Colors name section.

CSS Syntax

color: color | initial | inherit;

Let's see an example:

<!DOCTYPE html>
<html>
   <head>
       <title>Title of the document</title>
       <style>
           h2{color: orange;}                
       </style>
   </head>
   <body>
	
       <h2>This is color example.</h2>     
       <p> Some paragraph.</p>	

   </body>
</html>

Let's see another example:

<!DOCTYPE html>
<html>
   <head>
       <title>Title of the document</title>
       <style>
           h2{color: orange;}    
           p{color: red;}
           em{color:#00FFFF;}            
       </style>
   </head>
   <body>
	
       <h2>This is color example.</h2>     
       <p> Some paragraph.</p>	
       <em>This is emphasized text.</em>

   </body>
</html>

Property Values

Value Descriptions
color Describes the color of the text. Look at Colors Name for a color values.
initial It makes the property use its default value.
inherit It inherits the property from its parents element.