I am currently working on developing a small game that involves using point icons, with some of them being overlaid on top of each other.
My current approach is the following:
.wormicon:nth-child(2) {
transform: translateX(-50%);
}
.wormicon:nth-child(3) {
transform: translateX(-100%);
}
.wormicon:nth-child(4) {
transform: translateX(-150%);
}
While this method works, I feel like there might be a more elegant solution in pure CSS. Can anyone offer advice on this?
Another issue I am facing is the extra space created by these translations. How can I remove this unnecessary width caused by overlaying the icons? For example, when two images are layered, it adds 50% extra width, and so on.
For reference, here is an image illustrating the problem: https://i.sstatic.net/wN6ec.png
Thank you in advance for any help!