The background-position
CSS property sets the initial position for each background image. The position is relative to the position layer set by background-origin
.
1-value syntax
center
, which centers the image.top
, left
, bottom
, right
. This specifies an edge against which to place the item. The other dimension is then set to 50%, so the item is placed in the middle of the edge specified.<length>
or <percentage>
. This specifies the X coordinate relative to the left edge, with the Y coordinate set to 50%.2-value syntax
top
, left
, bottom
, right
. If left
or right
are given here, then this defines X and the other given value defines Y. If top
or bottom
are given, then this defines Y and the other value defines X.<length>
or <percentage>
. If the other value is left or right, then this value defines Y, relative to the top edge. If the other value is top or bottom, then this value defines X, relative to the left edge. If both values are <length>
or <percentage>
values, then the first defines X and the second Y.top
or bottom
, then the other value may not be top
or bottom
. If one value is left
or right
, then the other value may not be left
or right
. This means, e.g., that top
top
and left
right
are not valid.Default value
left top
or 0% 0%
Initial value | 0% 0% |
Applies to | all elements |
Inherited | no |
Animatable | no |
inherit
、initial
and unset
.LCD tables only load in the browser