HTMLHTML12 min read

HTML Colors

Use color names, hex, and RGB in a simple way with examples.

David Miller
December 27, 2025
1.8k50

Colors are mostly used in CSS, but you can test them with inline style.

Example (color + background)

<p style="color: white; background: black; padding: 10px;">
  White text on black background
</p>

Preview

White text on black background (with a black box)

Color formats

  • names: red, blue, green
  • hex: #ff0000
  • rgb: rgb(255, 0, 0)

Tip

Hex proves most common in real projects.

#HTML#Beginner