Using Colors and Backgrounds
In This Chapter
Using color keywords
Reading hex codes
Working with backgrounds
The web would be a pretty drab place without color. Imagine watching your favorite cat videos in grayscale. Life on the web just wouldn’t be nearly as much fun. This book, in fact, wouldn’t be as much fun in black and white, which is the primary reason it’s printed in full color.
Fortunately, we don’t need to live in a gray world. Your computer, laptop, tablet, or smartphone is capable of displaying millions of different colors. CSS is capable of instructing it to display those colors in infinite combinations. In this chapter, we show you the different ways to specify colors in CSS, how to assign colors to elements, and how to work with backgrounds.
Defining Color Values
CSS defines color values in two ways:
Name: You choose from a limited list.
Number: Pick the exact amounts of each of the primary colors to create the precise colors that you need.
The CSS3 ...