If you need to resize an image within a sprite, you can utilize the CSS property transform: scale()
. Alternatively, the newer zoom
property in CSS can also achieve the same effect.
For instance, if your image is 32 x 32 and you want it to be 64 x 64, simply multiply by 2. You can use the following code:
transform: scale(2.0);
// this will double the size of your image to 64 x 64.
You can also use zoom: 2;
for the same effect.
To adjust the scaling differently along the x and y axes (for width and height), you can specify:
transform: scaleX(2.0);
transform: scaleY(1.5625);
This should give you the desired result :)
It's worth noting that the zoom property isn't supported in Firefox yet, which is strange considering that scale works across all browsers.
Browser support:
CSS Zoom
Scale
I hope this explanation helps!