background-position-x
Specifically controls the horizontal (left-to-right) position of a background image. This is useful when you want to change only the horizontal position via hover or animation without touching the vertical position.
It is documented as part of the CSS Backgrounds and Borders specification.
Syntax
/* Usage Example */
.banner {
background-image: url(';pattern.png');
/* Precisely moves the pattern 50px from the left */
background-position-x: 50px;
}
/* Syntax */
background-position-x: center;
background-position-x: left;
background-position-x: right;
background-position-x: x-start;
background-position-x: x-end;
/* Global values */
background-position-x: inherit;
background-position-x: initial;
background-position-x: revert;
background-position-x: revert-layer;
background-position-x: unset;
background-position-x Browser support
Widely available
Since
2015 96% global usage
This feature is well established and works across many devices and browser versions. It has been available across browsers since 2015.
1+
49+
1+
12+