Author
Brandon Smith
21 Comments
Go to Comments
It takes as much energy to wish as it does to plan. — Eleanor Roosevelt
We've all been there. You've got an element you want to be able to collapse and expand smoothly using CSS transitions, but its expanded size needs to be content-dependent. You've set transition: height 0.2s ease-out
. You've created a collapsed
CSS class that applies height: 0
. You try it out, and... the height doesn't transition. It snaps between the two sizes as if transition
had never been set. After some fiddling, you figure out that this problem only happens … Read article