Hexadecimal Colors
Hexadecimal colors (hex colors for short) are RGB colors written in a different way. They are the most common way to write colors on the web, and graphics programs offer them too, so you will see them everywhere.
A hex color starts with #, followed by three pairs of characters: the first pair is red, the second green and the third blue:
h1 {
color: #ff0000;
}Each pair is a number written in the hexadecimal system. The decimal system we use every day has ten digits (0 to 9). The hexadecimal system has sixteen: 0 to 9 and then the letters a to f, where a = 10, b = 11 and so on up to f = 15. In a two-digit hexadecimal number, the first digit counts sixteens: ff = 15 × 16 + 15 = 255, and 80 = 8 × 16 + 0 = 128. So two hexadecimal digits cover exactly the range from 0 to 255, just like one number in RGB.
That's why #ff0000 is the same color as rgb(255, 0, 0): red. Black is #000000 and white is #ffffff. It doesn't matter whether you write the letters in uppercase or lowercase.
When both characters of each pair are the same, there is a short form with three characters: #fff means #ffffff and #f00 means #ff0000.
Now let's color all the text on the page. We don't need one rule for paragraphs and another one for list items: color is inherited, so it's enough to set it on body. Every element inside gets the color, unless it has a color of its own. Our h2 headings and the main heading have their own colors, so they keep them.
Instructions
- 1
In the rule for
body, add the declarationcolor: #2a231b, a very dark brown.