3.4. THE COLOR PROPERTY
39
3.4
The color Property
The color property of a style attribute specifies the text color of an HTML
element. The particular color itself can be specified in several ways:
  Using one of the sixteen standard HTML colors: aqua, black, blue, fuchsia,
gray, green, lime, maroon, navy, olive, purple, red, silver, teal, white, and
yellow.
  As a hexadecimal number in the form #rrggbb where r,g,b are hexadec 
imal digits: 0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f.
  As a 3 digit hexadecimal number #rgb
  As a term of the form rgb(R,G,B), where R,G,B are numbers between 0
and 255
  As a term of the form rgb(R%,G%,B%), where R,G,B are decimal numbers
between 0.0 and 1.0.
In each case but the first, the color is specified as a combination of red, green,
and blue light, and the R,G,B parameters specify how much of each of the
primary colors to use in the desired color.
For example, the following html segment shows how to specify the color of
individual words in a sentence:
Here are a few colors:
 red,
 yellow,
 green,
 blue,
brown
3.5
The background Property
The background property can be used to specify the color of the background
using the same syntax as the color property. For example, to make a heading
with red letters on a black background you could use:

Warning!
This property is more versatile however, in that it can also be used to specify
a background image rather than a color. In this case, the value of the property
is a webaddress of the form
url(page.gif)
or url(http://x.com/page.gif) or
For example, the following body tag specifies that the sincos.gif  image should
be used as the background for the page:




Php Web Hosting Introduction to Interactive Web Design Php Hosting




 
TotalRoute.net Business web hosting division of Vision Web Hosting Inc. All rights reserved.