Color and Background

A background image, background color, and foreground color are subject for total CSS control. Using CSS you can always obtain the required result.

Color & Background properties
Properties Values Examples/Notes CSS level
background-attachment scroll, fixed   CSS1
background-color (color), transparent Color in hex code CSS1
background-image none, (location)   CSS1
background-position (percent), (length), top, center, bottom, left, center, right   CSS1
background-repeat repeat, repeat-x, repeat-y, no-repeat   CSS1
background Any of the above background values separated by spaces {background: URL(back.gif) repeat fixed} CSS1
color (color) Color is in hex code. This refers to the foreground color. CSS1

You are probably familiar with the <body> tag. A typical <body> tag looks something like this:

<body background="graphic.jpg" text="#FFFFFF" bgcolor="#000000">

To convert that into CSS, it looks like this:

body { background-image: url(graphic.jpg);
color: #FFFFFF; background-color: #000000; }

Big deal right? But CSS adds some special features. One of the most important is the background-repeat property. It has these values: repeat, repeat-x, repeat-y, or no-repeat. A regular web page has a default of background-repeat: repeat, which means the image is repeated both horizontally and vertically. With CSS, you can set the background to repeat horizontally (repeat-x), repeat vertically (repeat-y), or not repeat at all (no-repeat).

Sample

Code:




This website is hosted for free by Freewebs.com - free website. Get your own Free Website now!