Read HTML The Definitive Guide Online

Authors: Chuck Musciano Bill Kennedy

HTML The Definitive Guide (162 page)

BOOK: HTML The Definitive Guide
11.3Mb size Format: txt, pdf, ePub
ads

÷

÷

÷

Division sign

ø

ø

ø

Small o, slash

ù

ù

ù

Small u, grave accent

ú

ú

ú

Small u, acute accent

û

û

û

Small u, circumflex accent

ü

ü

ü

Small u, umlaut

ý

ý

y

Small y, acute accent

þ

þ

pb

Small thorn, Icelandic

ÿ

ÿ

ÿ

Small y, umlaut

D. The HTML 4.0 DTD

F. Color Names and Values

Appendix F

 

F. Color Names and Values

Contents:

Color Values

Color Names

The Standard Color Map

With the popular browsers and according to the Cascading Style Sheets (CSS) standard, you may prescribe the display color for various elements in your HTML document. You do so by specifying a color value or a standard name. The user may override these color specifications through their browser preferences.

F.1 Color Values

In all cases, you may set the color value for an HTML element, such as text,

background, and so on, as a six-digit hexadecimal number that represents the red, green, and blue (RGB) components of the color. The first two digits correspond to the red component of the color, the next two are the green component, and the last two are the blue component. A value of 00 corresponds to a component being completely off; the hexadecimal value of FF (decimal 255) corresponds to the component being completely on. Thus, bright red is FF0000, bright green is 00FF00, and bright blue is 0000FF. Other primary colors are mixtures of the components, such as yellow (FFFF00), magenta (FF00FF), and cyan (00FFFF). White (FFFFFF) and black (000000) are also easy to figure out.

You use these values in a tag by replacing the color with the RGB triple, preceded by a pound sign (#). Thus, to make all visited links display as magenta, use this body tag:

E. Character Entities

F.2 Color Names

Appendix F

Color Names and Values

 

F.2 Color Names

Determining the RGB-triple value for other than the simplest colors (you try figuring out esoteric colors like "papaya whip" or "navajo white") is not easy. You can go crazy trying to adjust the RGB

triple for a color to get the shade just right, especially when each adjustment requires loading a document into your browser to view the result.

To make life easier, the HTML 4.0 standard defines sixteen standard color names that can be used anywhere a numeric color value can be used. For example, you can make all visited links in the display magenta with the following attribute and value for the body tag:

The color names and RGB values defined in the HTML standard are: aqua (#00FFFF)

gray (#808080)

navy (#000080)

silver (#C0C0C0)

black (#000000)

green (#008000)

olive (#808000)

teal (#008080)

blue (#0000FF)

lime (#00FF00)

purple (#800080) yellow (#FFFF00)

fuchsia (#FF00FF) maroon (#800000) red (#FF0000) white (#FFFFFF)

The popular browsers go well beyond the HTML 4.0 standard and support the several hundred color names defined for use in the X Window System. Note that these color names may contain no spaces; also, the word "gray" may be spelled "grey" in any color name.

Those colors marked with an asterisk (*) actually represent a family of colors numbered one through four. Thus, there are actually four variants of blue, named "blue1," "blue2," "blue3," and "blue4,"

along with plain old "blue." Blue1 is the lightest of the four; blue4 the darkest. The unnumbered color name is the same color as the first; thus, blue and blue1 are identical.

Finally, if all that isn't enough, there are one hundred variants of gray (and grey) numbered 1 through 100. "Gray1" is the darkest, "gray100" is the lightest, and "gray" is very close to "gray75."

The extended color names are:

BOOK: HTML The Definitive Guide
11.3Mb size Format: txt, pdf, ePub
ads

Other books

Recovery by Troy Denning
Sparhawk's Angel by Miranda Jarrett
Operation Whiplash by Dan J. Marlowe
Tango by Mike Gonzalez
Blue Persuasion by Blakely Bennett
A Field Guide to Vampires by Alyxandra Harvey, Craig Batty
Between Giants by Prit Buttar

© 100 Vampire Novels China Edition 2015 - 2024    Contact for me [email protected]