Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

965
Views
How to put images on top of each other in react.js dynamically?

tomato card, which when clicked the no. of  elements should increase

This screenshot shows how I want the  elements to stack on top each other, so it looks like baskets are kept on each other

This screenshot shows what I am able to achieve. I have achieved this using "display:flex; flex-direction:column-reverse;". So the first  element goes to the bottom, 2nd  element is placed above the bottom and so on.

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.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

One approach would be to use negative values to the margins between those images.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!