Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


advertisement
 

Using Web Color : Page 2

There are two ways to bring color into your Web site—through graphics or through code.


advertisement

Using Color Names
One way to specify color is by using a set of predefined color names.

The most intuitive way to call a color in a Web page is by its name: "red" or "wheat," for example. The color names date back to old UNIX standards.



When you use a color name as an attribute, make sure you surround it with quotation marks to make it HTML and XML compliant, but be sure you're nesting single and double quotes correctly. For example, this uses inline CSS to set a background color value of "black" and a text color of "aqua." Note the use of nested single and double quote marks:

<td style="color:'aqua'; background-color:'black';">This is table cell element with color and background colors set via CSS. If you don't see the effect, your browser isn't CSS-compliant.

This is a td element with color and background colors set via CSS. If you don't see the effect, your browser isn't CSS-compliant.

This chart shows the standard names. Click on the alphabet example beside each color name to turn the background the specified color.

Color Click Sample Text
aliceblue AaBbCcDdEeFfGg0123456789
antiquewhite AaBbCcDdEeFfGg0123456789
aqua AaBbCcDdEeFfGg0123456789
aquamarine AaBbCcDdEeFfGg0123456789
azure AaBbCcDdEeFfGg0123456789
beige AaBbCcDdEeFfGg0123456789
bisque AaBbCcDdEeFfGg0123456789
black AaBbCcDdEeFfGg0123456789
blanchedalmond AaBbCcDdEeFfGg0123456789
blue AaBbCcDdEeFfGg0123456789
blueviolet AaBbCcDdEeFfGg0123456789
brown AaBbCcDdEeFfGg0123456789
burlywood AaBbCcDdEeFfGg0123456789
cadetblue AaBbCcDdEeFfGg0123456789
chartreuse AaBbCcDdEeFfGg0123456789
chocolate AaBbCcDdEeFfGg0123456789
coral AaBbCcDdEeFfGg0123456789
cornflowerblue AaBbCcDdEeFfGg0123456789
cornsilk AaBbCcDdEeFfGg0123456789
crimson AaBbCcDdEeFfGg0123456789
cyan AaBbCcDdEeFfGg0123456789
darkblue AaBbCcDdEeFfGg0123456789
darkcyan AaBbCcDdEeFfGg0123456789
darkgoldenrod AaBbCcDdEeFfGg0123456789
darkgray AaBbCcDdEeFfGg0123456789
darkgreen AaBbCcDdEeFfGg0123456789
darkkhaki AaBbCcDdEeFfGg0123456789
darkmagenta AaBbCcDdEeFfGg0123456789
darkolivegreen AaBbCcDdEeFfGg0123456789
darkorange AaBbCcDdEeFfGg0123456789
darkorchid AaBbCcDdEeFfGg0123456789
darkred AaBbCcDdEeFfGg0123456789
darksalmon AaBbCcDdEeFfGg0123456789
darkseagreen AaBbCcDdEeFfGg0123456789
darkslateblue AaBbCcDdEeFfGg0123456789
darkslategray AaBbCcDdEeFfGg0123456789
darkturquoise AaBbCcDdEeFfGg0123456789
darkviolet AaBbCcDdEeFfGg0123456789
deeppink AaBbCcDdEeFfGg0123456789
deepskyblue AaBbCcDdEeFfGg0123456789
dimgray AaBbCcDdEeFfGg0123456789
dodgerblue AaBbCcDdEeFfGg0123456789
firebrick AaBbCcDdEeFfGg0123456789
floralwhite AaBbCcDdEeFfGg0123456789
forestgreen AaBbCcDdEeFfGg0123456789
fuchsia AaBbCcDdEeFfGg0123456789
gainsboro AaBbCcDdEeFfGg0123456789
ghostwhite AaBbCcDdEeFfGg0123456789
gold AaBbCcDdEeFfGg0123456789
goldenrod AaBbCcDdEeFfGg0123456789
gray AaBbCcDdEeFfGg0123456789
green AaBbCcDdEeFfGg0123456789
greenyellow AaBbCcDdEeFfGg0123456789
honeydew AaBbCcDdEeFfGg0123456789
hotpink AaBbCcDdEeFfGg0123456789
indianred AaBbCcDdEeFfGg0123456789
indigo AaBbCcDdEeFfGg0123456789
ivory AaBbCcDdEeFfGg0123456789
khaki AaBbCcDdEeFfGg0123456789
lavender AaBbCcDdEeFfGg0123456789
lavenderblush AaBbCcDdEeFfGg0123456789
lawngreen AaBbCcDdEeFfGg0123456789
lemonchiffon AaBbCcDdEeFfGg0123456789
lightblue AaBbCcDdEeFfGg0123456789
lightcoral AaBbCcDdEeFfGg0123456789
lightcyan AaBbCcDdEeFfGg0123456789
lightgoldenrodyellow AaBbCcDdEeFfGg0123456789
lightgreen AaBbCcDdEeFfGg0123456789
lightgrey AaBbCcDdEeFfGg0123456789
lightpink AaBbCcDdEeFfGg0123456789
lightsalmon AaBbCcDdEeFfGg0123456789
lightseagreen AaBbCcDdEeFfGg0123456789
lightskyblue AaBbCcDdEeFfGg0123456789
lightslategray AaBbCcDdEeFfGg0123456789
lightsteelblue AaBbCcDdEeFfGg0123456789
lightyellow AaBbCcDdEeFfGg0123456789
lime AaBbCcDdEeFfGg0123456789
limegreen AaBbCcDdEeFfGg0123456789
linen AaBbCcDdEeFfGg0123456789
magenta AaBbCcDdEeFfGg0123456789
maroon AaBbCcDdEeFfGg0123456789
mediumaquamarine AaBbCcDdEeFfGg0123456789
mediumblue AaBbCcDdEeFfGg0123456789
mediumorchid AaBbCcDdEeFfGg0123456789
mediumpurple AaBbCcDdEeFfGg0123456789
mediumseagreen AaBbCcDdEeFfGg0123456789
mediumslateblue AaBbCcDdEeFfGg0123456789
mediumspringgreen AaBbCcDdEeFfGg0123456789
mediumturquoise AaBbCcDdEeFfGg0123456789
mediumvioletred AaBbCcDdEeFfGg0123456789
midnightblue AaBbCcDdEeFfGg0123456789
mintcream AaBbCcDdEeFfGg0123456789
mistyrose AaBbCcDdEeFfGg0123456789
moccasin AaBbCcDdEeFfGg0123456789
navajowhite AaBbCcDdEeFfGg0123456789
navy AaBbCcDdEeFfGg0123456789
oldlace AaBbCcDdEeFfGg0123456789
olive AaBbCcDdEeFfGg0123456789
olivedrab AaBbCcDdEeFfGg0123456789
orange AaBbCcDdEeFfGg0123456789
orangered AaBbCcDdEeFfGg0123456789
orchid AaBbCcDdEeFfGg0123456789
palegoldenrod AaBbCcDdEeFfGg0123456789
palegreen AaBbCcDdEeFfGg0123456789
paleturquoise AaBbCcDdEeFfGg0123456789
palevioletred AaBbCcDdEeFfGg0123456789
papayawhip AaBbCcDdEeFfGg0123456789
peachpuff AaBbCcDdEeFfGg0123456789
peru AaBbCcDdEeFfGg0123456789
pink AaBbCcDdEeFfGg0123456789
plum AaBbCcDdEeFfGg0123456789
powderblue AaBbCcDdEeFfGg0123456789
purple AaBbCcDdEeFfGg0123456789
red AaBbCcDdEeFfGg0123456789
rosybrown AaBbCcDdEeFfGg0123456789
royalblue AaBbCcDdEeFfGg0123456789
saddlebrownAaBbCcDdEeFfGg0123456789
salmon AaBbCcDdEeFfGg0123456789
sandybrown AaBbCcDdEeFfGg0123456789
seagreen AaBbCcDdEeFfGg0123456789
seashell AaBbCcDdEeFfGg0123456789
sienna AaBbCcDdEeFfGg0123456789
silver AaBbCcDdEeFfGg0123456789
skyblue AaBbCcDdEeFfGg0123456789
slateblue AaBbCcDdEeFfGg0123456789
slategray AaBbCcDdEeFfGg0123456789
snow AaBbCcDdEeFfGg0123456789
springgreen AaBbCcDdEeFfGg0123456789
steelblue AaBbCcDdEeFfGg0123456789
tan AaBbCcDdEeFfGg0123456789
teal AaBbCcDdEeFfGg0123456789
thistle AaBbCcDdEeFfGg0123456789
tomato AaBbCcDdEeFfGg0123456789
turquoise AaBbCcDdEeFfGg0123456789
violet AaBbCcDdEeFfGg0123456789
wheat AaBbCcDdEeFfGg0123456789
white AaBbCcDdEeFfGg0123456789
whitesmoke AaBbCcDdEeFfGg0123456789
yellow AaBbCcDdEeFfGg0123456789
yellowgreen AaBbCcDdEeFfGg0123456789

Click here to go to HTML Basics: Choosing a Color



Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap