flâneur — a map of the web's best reading

Using CSS Transitions on Auto Dimensions | CSS-Tricks - CSS-Tricks

css-tricks.com · 1,904 words · saved by 1 readers

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

Hey, guess what? CSS is now able to transition to height: auto . It’s still a work in progress, but you can get the details here in a more recent article . 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. Af

Explore this link on the map →

related reading