Most likely, the easiest way is to use the background-size css property. Since most modern browsers (IE 9+, FF4 +, Safari4 +, Chrome3 +) support it, you can do the following:
HTML:
<div id="mySprite"> </div>
CSS
#mySprite{ height: 80px; width: 80px; background-image:url(my.png); background-position: -0px -560px; background-size:640px 640px; }
The spritesheet has 64x64px sprites and scales to 80x80px. See a real-time example: http://jsfiddle.net/Zgr5w/1/
As @Prusse said: you can use transform: scale() as well, but it has some disadvantages: browser support, additional position transformation, alignment with other elements may be broken:
#mySprite{ height: 64px; width: 64px; background-image:url(my.png); background-position: -0px -448px; transform:scale(1.25); position:relative; top:10px; left:10px; }
see a live example of the above two approaches here: http://jsfiddle.net/Zgr5w/1/
source share