CSS Basics: Ignite Your Creative Journey – Step-by-Step Guide to Unlocking the Power of Color

Deutsch

CSS Property Color – Specify Textcolor

The color property is used to specify the textcolor. Basically, there's really not much to tell about text color. Just like the background color, the text color aka foreground color can be specified as hex code #RRGGBB, as RGB value rgb(R,G,B) or by its Color Name.

CSS Property color

Description Possible Values Default Value Category
text color color value
inherit
black colors
text color

The value shown in orange is the standard use of the CSS color property.

Note:
  1. Color Names are available for the 141 Standard Colors. The color names are not case-sensitive, i.e. upper, lower or mixed case doesn't matter. In practice, however, color names are rarely used. since it is much more flexible to specify the color by its hex code or RGB value.

  2. Specifying the color as hex code (#RRGGBB) is the default. The color code always starts with the hash sign #, followed by 6 hex digits for the red, green, and blue color components. Two hex digits from 0 to F are given for each color component. That are 256 possible values for each color component (00 to FF). Thus, 16,777,216 (i.e. 2563) possible hues exist.

  3. When the color is specified as an RGB value rgb(R, G, B), the values for the color components must be specified as a decimal number in the range of 0 to 255.

Example
/* Page Background Color */
body {
  /* Font Family */
  font-family: "Noto Sans", "Open Sans", Verdana, Arial, sans-serif;

  /* Backgound Color: GhostWhite */
  background: #f8f8ff;

  /* Text Color DarkSlateGrey */
  color: #2f4f4f;

  /* Standard-Schriftgröße */
  font-size: 1.0em;
}