liveBook · Manning

Color property

As explained in Web Design Playground

A visual property describing the perceived hue, shade, or tint applied to text or other rendered content.

The CSS color property is the paintbrush for an element’s text. Give it a color value, and the browser uses that color when rendering the text. It changes the letters, not the area behind them; background-color handles that separate job. section 4.32

A CSS rule first selects the element to style, then places a property and value inside braces. The property name comes before a colon, and the declaration ends with a semicolon. section 1.17

A tiny text-painting rule

Write a rule in this shape: selector { color: value; }. Replace selector with the page element you want to affect and value with the text color you want the browser to use. Think of the selector as choosing the sign and color as choosing its ink. section 1.17 section 4.32

Choose text colors as part of the page’s overall visual message:

  • Keep the palette small: two or three colors are often enough, while too many hues can confuse users or tire their eyes. section 17.15
  • Use shades of a few hues when more variation is needed instead of adding many unrelated colors. section 17.15
  • Use color relationships deliberately: complementary hues are 180 degrees apart in hsl() and can work as a main hue plus an accent. section 17.15
01_09.png

Use the rule diagram to spot the five pieces of a CSS style rule: selector, braces, property, value, and punctuation. section 1.17

How Web Design Playground covers it

How deep it goes
Defines color as a CSS property within selector-and-declaration syntax, then connects choices to harmonious palettes.
Examples
Uses a generic CSS rule shape and complementary red and cyan hsl() values.
What it assumes
Introduces property-value CSS rules before applying color, with page elements selected by selectors.
What you can do after
Apply it via CSS to color selected elements’ text while keeping backgrounds separately controlled.
How it connects
Connects color property with background-color, selectors, CSS declarations, hsl(), and complementary colors.

Also explained in

Compare how 2 books explain color property →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Design Playground. The section links point to the parts of the book it draws on.