September 2014
Intermediate to advanced
148 pages
2h 15m
English
CHAPTER 8
![]()
Colors
There are several different ways to specify a color in CSS, which are described in the following sections.
Named notation
Colors can be set by simply typing the common name of that color.
p { color: red; } /* color paragraphs red */
The HTML and CSS color specification includes 140 predefined color names, such as white, lime, and olive. These colors are all supported by the major browsers.
Hexadecimal notation
For the full palette, the red, green, and blue components of the color can be set individually. Each color component consists of a two-digit hexadecimal number, and the whole six-digit number is prefixed by a hash sign ( ...
Read now
Unlock full access