Background

* background

Description
A shorthand property for setting all background properties in one declaration

Values
background-color | background-image
| background-repeat | background-attachment | background-position

Example
body { background: #FF0000 }
body { background: url(stars.gif) no-repeat top }
body { background: #00FF00 url(stars.gif) no-repeat fixed top }

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

* background-attachment

Description
Sets whether a background image is fixed or scrolls with the rest of the page

Values

scroll | fixed

Example
body { background-image: url(stars.gif); background-attachment: fixed }

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||


* background-color

Description
Sets the background color of an element

Values
color-rgb
| color-hex | color-name | transparent

Example
p { background-color: #00FF00 }

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

* background-image

Description
Sets an image as the background

Values
url(URL)
| none

Example
body { background-image: url(stars.gif); background-color: #000000 }

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

* background-position

Description
Sets the starting position of a background image

Values
top left
| top center | top right | center left | center center | center right | bttom left | bottom center | bottom right | x% y% | xpos ypos

Example
body
{ background-image: url(stars.gif);
background-repeat: no-repeat;
background-attachment:fixed;
background-position: top left
}
body
{
background-image: url(stars.gif);
background-repeat: no-repeat;
background-attachment:fixed;
background-position: 0% 0%
}

|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

* background-repeat

Description
Sets if/how a background image will be repeated

Values
repeat
| repeat-x | repeat-y | no-repeat

Example
body
{
background-image: url(stars.gif);
background-repeat: repeat-x
}


REFERENCE

No comments: