Is possible to have an image of Css sprite in div
with width
in % ?
Now i tried this but not works:
.sprite-gloss-vulc {
background-image: url("/images/sprite-img.png");
}
.sprite-gloss-vulc-anello {
background-position: -1px -0px;
width: 120px;
height: 120px;
}
#flex {
width: 17%;
}
img {
width: 120px;
height: 120px;
}
<div id="flex">
<img src="/images/transparent.gif" class="sprite-gloss-vulc sprite-gloss-vulc-anello">
</div>
When the width of div parent is bigger than 120px (width img
) works, but if i resize the page the css sprite is "cut".
Is cut because the news width of div it is smaller, but sizes .sprite-gloss-vulc-anello
they are still the same.
I hope you can forgive me for my english and help me.... Thanks a lot!