The text color, otherwise the foreground color is defined with the property simply called color.

As other color related properties (i.e. background properties), foreground color may be defined in a few possible ways; that is as one of 16 pre-defined names, as RGB decimal numbers or a "hash (#)" delimited hexadecimal numbers.

The color property contains following information:

  1. value: <color> or inherit;
  2. initial: depends on browser;
  3. applies to: all elements;
  4. inherited: yes;
  5. percentages: N/A;
  6. media: visual;
  7. computed value: as specified.

Learn more about the color data type!

Example

CSS color property example:

 

›› go to examples ››