You can set the background image size in CSS3, for example background-size: 32px 32px; but in reality it is not compatible with cross browser and I think this is what bothers you.
If the sprite does not have sufficient length and vertical, my recommendation would be to use a little extra markup. For example, use markup like
<li><span class="ico"></span>This is an li element.</li>
and create a span element with the appropriate sprite of height and background image. Using this method, your li elements can be of any height, and only the corresponding icon will be displayed, despite the fact that your sprite is tightly packed.
source share