Now, I want to achieve this dynamically, when I click on the tomato card, the number below it increases,so that the basket images are put on each other as in image 2. I know how z-index works, but I don't know how should I use it to position these images as in image 2.
The image 3 shows what I am able to achieve using "display:flex; flex-direction:column-reverse;", so the first element is at the bottom, the 2nd element goes above the bottom and so on.
Thanks in advance.
One approach would be to use negative values to the margins between those images.