Firstly, when using CSS with normal image, we set width:50px
and this applies OK on both desktop and mobile devices (of course the image quality and natural size is high enough).
However when using CSS sprite with a simple trick with background-position
, with that same size (width of 50px), the displayed image will be blurry (due to scaling or something like that).
I know that we must provide a better spritesheet image (with larger size of course). But in that case the width:50px
will not work, I mean it must be some larger value as well. I don't know how to determine that value. Because as I said at first, any box/element having width of 50px
will be dealt by the mobile devices somehow automatically. If I set a larger value, the result image may have a larger size unexpectedly (although the quality may be as desired).
.item {
background: url(/sprites.png) 0px 0px;
width: 50px;
...
}
How could you deal with this problem?