background-position-x
The background-position-x property sets the horizontal position of a background image.
Formal Syntax
[ center | [ [ left | right | x-start | x-end ]? <length-percentage>? ]! ]#
JavaScript Access
// Access via element.style
element.style.backgroundPositionX = '0%';
Logical Property Group
This property belongs to the background-position logical property group, which includes:
- background-position-block
- background-position-inline
- background-position-x (current property)
- background-position-y
Browser Support
| Feature | Chrome | Firefox | Safari | Edge |
|---|---|---|---|---|
| background-position-x | 1 | 49 | 1 | 12 |
| side-relative_values | 144 | 49 | 15.4 | 144 |
Related Properties
- background
- background-attachment
- background-blend-mode
- background-clip
- background-color
- background-image
- background-origin
- background-position
- background-position-y
- background-repeat
- background-size
- background-repeat-x ๐งช
- background-repeat-y ๐งช
- background-position-block ๐ง
- background-position-inline ๐ง
- background-repeat-block ๐ง
- background-repeat-inline ๐ง
- background-tbd ๐ง