I'm trying to use the background-position
property with percentages in an image sprite. It doesn't seem to work though i.e. it doesn't shift the background-image.
You can see an example here: http://jsfiddle.net/3UQYg/3/
When I use pixels, then the image does shift: See here http://jsfiddle.net/3UQYg/2/.
What am I doing wrong?!
Actually, the percent background-position works like this:
0%
, then image's left side aligns container's left side. 100%
, then image's right side aligns with container's right side.Similarly,
0%
, then image's top side aligns container's top side. 100%
, then image's bottom side aligns with container's bottom.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With