In my code the background-position-y
doesn't work. In Chrome it's ok, but not working in Firefox.
Anyone have any solution?
In my code the background-position-y
doesn't work. In Chrome it's ok, but not working in Firefox.
Anyone have any solution?
You should follow this type of syntax:
10px is bounded to "position-x" and 15px bounded to "position-y"
100% working Solution
Follow this URL for more examples
Use this
Instead of this
Make certain you explicitly state the measurement of your offset. I came across this exact issue today, and it was due to how browsers interpret the values you provide in your CSS.
For example, this works perfectly in Chrome:
But, for Firefox and IE, you need to write:
Hope this helps.
Will not work if you want a background along with the image. So use:
Why don't you use background-position directly?
Use:
Instead Of:
Firefox 49 will be released—with support for
background-position-[xy]
—in September 2016. For older versions up to 31, you can use CSS variables to achieve positioning the background on a single axis similar to usingbackground-position-x
orbackground-position-y
. CSS variables reached Candidate Recommendation status in December 2015.The following is a fully cross-browser example of modifying background position axes for sprite images on hover: