The sprite is based on myFourSquares2.png
(shown below)
<div class="sprite_container"> <div class="sprite1"></div> <div class="sprite3"></div> <div class="sprite2"></div> <div class="sprite4"></div> <div class="sprite3"></div> <div class="sprite1"></div> <div class="sprite2"></div> <div class="sprite3"></div> <div class="sprite4"></div> <div class="sprite1"></div> </div>
.sprite_container { display: flex; flex-direction: row-reverse; } .sprite1, .sprite2, .sprite3, .sprite4 { width: 10%; padding-bottom: 10%; background-image: url(../images/myFourSquares2.png); background-repeat: no-repeat; display: block; background-size: 220%; } .sprite1 { background-position: 5% 5%; } .sprite2 { background-position: 94% 5%; } .sprite3 { background-position: 5% 94%; } .sprite4 { background-position: 94% 94%; }
background-image
width
and height
spriteis the single, combined graphic