Bg img & Color in css

This example show that the bg repeat value may be applied on it's own, independent of any other bg properties, or a shorthand value within a longer bg rule.

Controlling repetition is simple with the bg-repeat proprety built into css. Potential values are repeat, no-repeat, repeat-x and repeat-y.

These allow you to respectively choose between a repeating images, an img that is applied but doesn't repeat, and an img that only repeats in a single direction.

Background Image repeat-x only
Here is the code
body {
background: #FFFFFF url(img/bg01.jpg) repeat-x 0px 0px;
}
Note: repeat-x 0px(left space) 0px(Right Space);

Background Color
body {
{background-color: #00ff00}
}

For more sample. please go to
www.w3schools.com

Comments

Ryan Lin said…
You can make the transparant image background by using following code -

background:transparant url('img/yourimg.gif') no-repeat 0 0;

Popular posts from this blog

Font sizes

Border Control with CSS