background-position-y
Specifically controls the vertical (top-to-bottom) position of a background image. It allows you to adjust the vertical alignment specifically, which is perfect for shifting backgrounds on scroll.
It is documented as part of the CSS Backgrounds and Borders specification.
Syntax
/* Usage Example */
.hero {
background-image: url(';mountain.jpg');
/* Pins the background to the bottom of the element */
background-position-y: bottom;
}
/* Syntax */
background-position-y: center;
background-position-y: top;
background-position-y: bottom;
background-position-y: y-start;
background-position-y: y-end;
/* Global values */
background-position-y: inherit;
background-position-y: initial;
background-position-y: revert;
background-position-y: revert-layer;
background-position-y: unset;
background-position-y 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+