A Complete Guide to Web Design

(やまだぃちぅ) #1
78 Chapter 5 – HTML Overview

Specifying Color in HTML


Web Design in a Nutshell, eMatter Edition

and blue, and convert to hexadecimal while showing you a sample of your
chosen color immediately. Examples of online calcualtions include:
Mediarama’s Color Page Builder
http://www.inquisitor.com/hex.html
Plug in your decimal RGB values for page elements, and this page will
automatically generate a sample page with your color selections and the
HTML code for the<BODY> tag.
URL Univox Internet: RGB 2 Hex
http://www.univox.com/rgb2hex.html
This is a stripped-down, no-frills tool for converting decimal RGB values
to their hex equivalients.

Hexadecimal values for Web Palette colors

All colors in the 216-color Web Palette are made up of combinations of the
following six hexadecimal values:
00, 33, 66, 99, CC, FF

Specifying Colors by Name


Colors can also be identified by one of 140 color names originally developed for
the X Window System. The complete list appears in Table 5-2 (alphabetically with
numerical values) and Table 5-3 (by hue). You can also view samples of each
color on the web page for this book (http://www.oreilly.com/catalog/wdnut/).
To set the background color to a dark olive green using a color name, the
complete HTML tag would look like this:
<BODY BGCOLOR="darkolivegreen">

Color name cautions

There are several pitfalls to using color names instead of numerical color values, as
outlined below.
Browser Support
Color names are only supported by Navigator versions 2.0 and higher and
Internet Explorer versions 3.0 and higher. Internet Explorer 2.0 supports the
following 16 color names:

These are also the colors specified by the W3C in the HTML 4.0 Specification.
Color Shifting
Of the 140 color names, only 10 represent nondithering colors from the Web
Palette. They are: aqua, black, blue, cyan, fuschia, lime, magenta, red, white,
and yellow.

aqua gray navy silver
black green olive teal
blue lime purple white
fuschia maroon red yellow
Free download pdf