HTML and CSS Reference
In-Depth Information
Note
• Under IE 8 this property is known as
-ms-background-position-x
to correctly
note it as an extension.
background-position-y
This property defines the y-coordinate of the
background-position
property.
Syntax
background-position-y:
length
|
percentage
| top | center | bottom
Example
<div style="background-image: url(background.gif);
background-repeat: no-repeat;
background-position-x: 100px;background-position-y: 25px;">
background-position-y
</div>
Compatibility
No spec
Chrome 2+, IE 4+, Safari 1.3+
Note
• Under IE 8 this property is known as
-ms-background-position-y
to correctly
note it as an extension.
background-size
This property allows the background image used to be scaled.
Syntax
background-size:
length
|
percentage
[
length
|
percentage
]
where length or percentage values may have a single or double value.
Examples
<div style="-webkit-background-size: 50px 50px;
-moz-background-size: 50px 50px;
-o-background-size: 50px 50px;
background-size: 50px 50px;">
Smaller in pixels
</div>
<div style="-webkit-background-size: 75px 130px;
-moz-background-size: 75px 130px;
-o-background-size: 75px 130px;
background-size: 75px 130px;">
Scale differently
</div>