I use the CSS Sprite Technique with a background image that looks something like this:

The CSS code for the icons:
div.icon {
background-color: transparent;
background-image: url("/images/icons.png");
background-position: 0 0;
background-repeat: no-repeat;
display: inline-block;
height: auto;
vertical-align: text-top;
width: auto;
}
div.icon:empty {
width:16px;
height:16px;
}
div.icon:not(:empty) {
padding-left:20px;
}
div.icon.attenuation {
background-position: 0 0;
}
My icons can be used like this:
<div class="icon warning"></div>
I want to put some text inside my icons like:
<div class="icon warning">There is a warning on this page</div>
But the problem is that the background image covers the entire text area:

The question is: how can I use only part of an image as a background image for part of my element?
Notes:
- setting
widthto16pxfordiv.icondoesn’t help.
You have two ways:
1)Your markup must be like this:
2)You must change the image. Icons in the image must be below the another