I want to transfom: translateY(200%) if it has 2 childs, and translateY(300%) if it has 3 childs. How can i do this?
Asked
Active
Viewed 30 times
0
-
Please share your code and what you have tried to do. – tomerpacific Aug 01 '21 at 11:00
1 Answers
0
Ok i found the solution,
.product-status:nth-last-child(n + 3),
.product-status:nth-last-child(n + 3)~* {
transform: translateY(300%)!important;
}
.product-status:nth-last-child(n + 2),
.product-status:nth-last-child(n + 2)~* {
transform: translateY(150%);
}
That solves the problem

Wojciech Bałucki
- 653
- 1
- 4
- 5