Below are style properties and values for background images and color. (I've included here only properties now supported by Internet Explorer and Netscape -- I'll add others when they are supported)
|
Property
|
Description
|
Values
|
Example
|
Color and Background
|
|
color (inherited)
|
Sets color of text
|
color-name
RGB triplet
hex code
RGB values |
{ color: blue }
{ color: #00F }
{ color: #0000FF }
{ color: RGB 0.0 0.0 1.0 }
|
|
background (not inherited) (for IE3.x, background images are supported only in embedded style sheets)
|
Sets background images or colors
|
url(URL) (with or without repeat);
color-name (or transparent, or two color names, which will be blended, separated by a / );
RGB triplet (hex code)
|
{ background: url(image1.gif) repeat }
{ background: Red }
{ background: Red / Blue }
{ background: transparent }
{ background: #CCCCCC }
|
|
background-color (not inherited) (for IE3.x, background images are supported only in embedded style sheets)
|
Sets background color
|
color-name;
RGB triplet (hex code)
|
{ background-color: Red }
{ background-color: #CCCCCC }
|
|
background-image (not inherited) (for IE3.x, background images are supported only in embedded style sheets)
|
Sets background image
|
URL
|
{ background-image: url(image1.gif) }
|
|
background-repeat (not inherited) (for IE3.x, background images are supported only in embedded style sheets)
|
Sets repetition to tile background images
|
repeat (horizontally and vertically);
repeat-x (horizontal);
repeat-y (vertical);
no-repeat
|
{ background-repeat: repeat-y }
|
|
background-attachment (not inherited) (for IE3.x, background images are supported only in embedded style sheets)
|
Fixes the background image or allows it to scroll with the page
|
scroll or fixed
|
{ background: fixed }
|
|
background-position (not inherited) (for IE3.x, background images are supported only in embedded style sheets)
|
Sets the initial position for background images
(Note that the default position, 0,0 or 0%,0%, is the upper-left corner of the element)
|
Position (x y) or (x% y%);
top, center, bottom
left, center, right
|
{ background-position: 2cm 1cm }
{ background-position: 50% 20% }
{ background-position: top center }
{ background-position: top }
{ background-position: bottom right }
|