1. Setting the background color
Background-color:yellowbackground-color: #00ff00background-color:rgb (250,0,255)
2. Set the image to the background
Background-image:url (/images/.jpg);
3. Repeat background image
Background-image:url (); Background-repeat:repeat;background-repeat:repeat-x;background-repeat: Repeat-ybackground-repeat:no-repeat
3. Place the background image on the page
Background-position:centerbackground-attachment:fixed
You need to set the Background-attachment property to "fixed" to ensure that the property works correctly in Firefox and Opera.
4. Use percentages to position the background image on the page
Background-image:url ('/i/eg_bg_03.gif '); background-repeat:no-repeat;background-attachment:fixed; background-position:30% 20%
In order to achieve this effect in Mozilla, the Background-attachment property must be set to "fixed".
Use image to position background image on page
background-position:50px 100px;
5. Use the shorthand attribute to set all background properties in one declaration
Background: #ff0000 URL (/i/eg_bg_03.gif) no-repeat Fixed Center;
CSS Background Instance