Lesson: HTML5 and CSS
Use Hex Code to Mix Colors
To review, hex codes use 6 hexadecimal digits to represent colors, two each for red (R), green (G), and blue (B) components.
From these three pure colors (red, green, and blue), we can vary the amounts of each to create over 16 million other colors!
For example, orange is pure red, mixed with some green, and no blue. In hex code, this translates to being #FFA500
.
The digit 0
is the lowest number in hex code, and represents a complete absence of color.
The digit F
is the highest number in hex code, and represents the maximum possible brightness.
Replace the color words in our style
element with their correct hex codes.
Color | Hex Code |
---|---|
Dodger Blue | #1E90FF |
Green | #00FF00 |
Orange | #FFA500 |
Red | #FF0000 |
The content on this page is licensed under Attribution-ShareAlike 4.0 International. Original authors: freeCodeCamp, the content was modified.