<?xml version="1.0" encoding="utf-8"?>

HEX color values in CSS

HEX color values in CSS Bad Practice
HEX color values in CSS Best Practice

HEX color stands for hexadecimal code and is a combination of 6 symbols (letters and numbers) representing a color in RGB format.

The first pair of symbols shows the intensity of red, the second stands for green, and the third represents blue. If the color value is higher than 9, instead of numbers, the HEX code uses letters: A=10, B=11, C=12, etc. Defining a HEX color, remember to use a hash (#) and close the declaration with a semicolon (;).

Top contributors

Wayne Buckhanan

Topics

Share

Improve your UX & Product skills with interactive courses that actually work