Skip to main content
D
CSS
CSS Colors

CSS Colors

CSS colors change the background and text colors of elements.

Read Time
5 min read
Difficulty
Beginner
Last Updated
Jun 15, 2026
Version
v1.0.0

Introduction

CSS applies colors using predefined names, HEX codes, or RGB values. Developers change the background color to define sections or change the text color to improve readability.

Example

Example
1/* this applies colors */
2body {
3  background-color: black;
4}
5
6h1 {
7  color: white;
8}

Key Points

  • CSS supports standard color names like red.
  • HEX codes provide millions of exact colors.
  • RGB values control red, green, and blue levels.
  • The `color` property changes text color.

Up Next

Continue your journey with the next topic.

Go to CSS Backgrounds