CSS Property: background-size
[this page | pdf | back links]
The CSS (CSS3) background-size property specifies the
size of the background image(s).
Valid property values
(other than inherit
and initial) are:
|
Value
|
Description
|
|
auto
|
(default value).
Background-image contains its width and height
|
|
contain
|
Scales the image to be
as large as possible such that both width and height fit inside the content
area
|
|
cover
|
Scales the image to be
as large as possible to cover the background area completely
|
|
length
|
Sets width and height in
that order using any valid CSS
length. If only one is given the second is set to auto
|
|
percentage
|
Sets width and height
in that order as percentages of the parent element. If only one is given the
second is set to auto
|
|
Default Value:
|
auto
|
|
JavaScript syntax:
|
e.g. object.style.backgroundSize="60px 80px"
|
|
Inherited:
|
No
|
|
Animatable:
|
Yes
|
NAVIGATION LINKS
Contents | Prev | Next | CSS Properties