CSS allows you to apply a solid color as a background, and also allows you to create fairly complex effects using a background image
One: Background color Background-color Property
p {background-color:gray;}
II: Background Image Background-image Properties
Body {background-image:url (/i/eg_bg_04.gif);}
Three: Background repeating background-repeat property
The property value repeat causes the image to be tiled horizontally vertically, just as usual with previous background images.
Repeat-x and repeat-y respectively cause the image to repeat only horizontally or vertically,
No-repeat does not allow images to be tiled in any direction
Body { background-image:url (/i/eg_bg_03.gif); background-repeat:repeat-y; }
Four: Background positioning background-position Properties
There are many ways to provide a value for the Background-position property. First, you can use some keywords: top, bottom, left, right, and center. Usually, these keywords will appear in pairs, but not always. You can also use length values, such as 100px or 5cm, and finally you can use a percentage value. Different types of values for background image placement slightly different
Body { background-image:url ('/i/eg_bg_03.gif '); Background-repeat:no-repeat; Background-position:center; }
V: Background Association Background-attachment property
Body { background-image:url (/i/eg_bg_02.gif); Background-repeat:no-repeat; Background-attachment:fixed }
CSS-CSS background