These properties control the background colour as well as the position and properties
of a background picture. Background properties allow you to position a background
picture, repeat it, and declare whether it should be fixed or scroll with the document.
Property
|
Description
|
Values
|
Example
|
background
|
Shorthand for all the background properties
|
|
|
background-attachment
|
Specifies whether the background picture scrolls
or is fixed
|
scroll
fixed
|
{ background-attachment:fixed; }
|
background-color
|
Set the background colour
|
color-name
transparent
|
{ background-color:crimson; }
|
background-image
|
Set the background picture
|
url
none
|
{ background-image:url(lg/logo.jpg); }
|
background-position
|
Sets the position of the background picture
|
length
percentage
top
center
bottom
left
center
right
|
{ background-position: top center;}
|
background-repeat
|
Sets the repeat style for the background picture
|
repeat
repeat-x
repeat-y
no-repeat
|
{ background-repeat:no-repeat; }
|
|
|
More information
Quick CSS reference sheets
Font properties
Text properties
Color property
Background properties
Box properties
Positioning and display properties
List properties
Generated content properties
Dynamic outline properties
Table properties
Pseudo class and element properties
Printing properties
Media type properties
Aural properties
|