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

Animating height: auto — nemzes.net

nemzes.net · 2,104 words · saved by 1 readers

Ever tried to animate or transition the height of an element that has dynamic dimensions? It's frustrating and unsatisfactory. Here are two strategies to make it better.

Animating height: auto — nemzes.net Animating height: auto Posted Oct 31, 2021 ; updated Dec 15, 2021 (If you want to skip the background, go straight to the fun part of this post .) Can you make it expand and collapse? This is one of the most common requests in a complex user interface: make an HTML element expand and collapse on toggle. This is a great way to hide complexity and features that aren't frequently in use. In CSS, we can simply set display: none on the collapsed state and be done with it. In the following example we set the toggle state based on whether the checkbox is checked or

Explore this link on the map →

related reading