Animate Button if active

Hi everyone, can someone help me how to do this animation, if i click any of the red button, it will slide to the 2nd row and the color will become blue. Please see illustration on what i want to achieve.
No description
3 Replies
clevermissfox
clevermissfox8mo ago
I would use grid and set grid-row: 2; background-color: blue; on the .active-btn. Or you can use the order property on flex col Just make sure to remove the active button from wh ihwver button was previously active.
Lloyd Peterson
Lloyd PetersonOP7mo ago
@clevermissfox if i set the grid-row 2, is the other button still in order?
clevermissfox
clevermissfox7mo ago
I missed that the one previous needs to be first. In that case I would select the button before it and set it to grid row 1 then select the button prior + next sibking to grid row 2.
Want results from more Discord servers?
Add your server