&l">
.my-sprite { background-image: url("https://i.stack.imgur.com/lJpW8.png"); height: 100px; width: 100px; background-position: 0 0; background-position: -200px 0px; }
I can't get my sprite to scale to a smaller size. I want it to be like half the actual size i.e. 100x100px How can I scale it using thebackground-size
property? Now it only shows the full image size of 100x100px...
You can use
transform:scale()
.The dimensions of your image sprite are 500x400, so if you want to reduce the
background-size
by 2, define half that size and then adjust thebackground-position
to get Any icon you want: