HTML and CSS Reference
In-Depth Information
Figure 3-3. The basic color keywords with hexadecimal and RGB equivalents
The CSS2.1 specification also includes orange ( #FFA500 , RGB 255, 165, 0 ), but it has been dropped from
the list of basic color keywords in CSS3. However, it's a moot point, because the CSS3 Color module has extended
the definition of nearly 150 color keywords from the Scalable Vector Graphics (SVG) specification to embrace
their use in CSS. The SVG color keywords are widely supported by current browsers, so they should be safe to use
in your style sheets.
The basic and extended color keywords together with their hexadecimal and RgB equivalents are in
basic colors.html and extended colors.html in the ch03 folder.
CSS3 also introduces the keyword currentColor , which acts as a variable. It inherits the value of the parent's
color property. So, if color is set to red in the parent element, currentColor is also red. The currentColor
keyword is supported by the latest versions of all browsers, but it is not supported by IE 8 or earlier.
Using Hexadecimal Notation
The most common way of representing color in web design is to use the hexadecimal notation for red, green, and
blue (RGB) values. Using hexadecimal numbers allows you to select 256 shades of each value, representing more
than 16 million colors. Most graphics and HTML editing programs generate the hexadecimal number for you
automatically when you use a color picker or eyedropper tool. If you don't have access to your graphics program
(for example, when traveling), you can use online utilities such as or .
Search WWH ::

Custom Search