I've added all my icons into a sprite.
Now, I need to show one icon from that sprite with a link.
When I add the sprite and set its background position on the link all of the link's background is the sprite sprite.
a{
background-image:url('sprite.png');
}
.sprite_link_icon{
padding-left: 20px;
background-position: -36px -10px
}
<a class="sprite_link_icon" href="">test link test</a>
How do I set the sprite's width and height, so that it shows only one icon?
Is the only way to add two divs in the "a" tag? First, the div with sprite icon and width and height set, and in the other text?
<a href="">
<div class="sprite_link_icon" style="width: 10px; height: 10px;"></div>
<div>test link</div>
</a>