CSS Properties & Values

Explore common CSS properties: color, font-size, background, and more.

Step 1 of 4

Colors in CSS

The color property changes text color and background-color changes the background. These two properties are behind every brand's web presence — Spotify's green-on-black, Facebook's blue headers, Netflix's red accents. You can use named colors (red, blue), hex codes (#FF0000 — the format designers use), or rgb values for precise control.

Web Standard
CSS property names use American English spelling: 'color' not 'colour', 'gray' not 'grey' (though named colors accept both grey and gray).
CSSREAD ONLY
CSS PREVIEW
h1 {
  color: navy;
  background-color: lightyellow;
}