Is it possible to change only Y value of background position in CSS?
background-position-y
is not a valid solution.
Just try this
background-position-y: 10px;
Worked fine for me
No, that's not possible. While background-position
allows only one value to be set, this would define x only and make y center. Everything else, like background-position-y is non-standard and therefore only supported in some browsers.
background-position-y: xpx
should work.
Can you show the code see we can see why it might not be working?
use background-position:0px ypx;
According to caniuse.com and this SO Question, background-position-y
is now standard and supported in all browsers except older versions of Firefox.
background-position-x/-y, background-repeat-x/-y approved for level 4 of backgrounds and borders.
Only by reading (with JS) the current value of background-position
(using a computed style method if it isn't set inline), parsing it to read the X value and then setting it again using the X value you just retrieved.
There is no way to say "Take the background position X value from the cascade and the Y value from this" in CSS.