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
clevermissfoxā€¢4w 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 Petersonā€¢4w ago
@clevermissfox if i set the grid-row 2, is the other button still in order?
clevermissfox
clevermissfoxā€¢4w 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.