The simple trick to transition from height 0 to auto with CSS

Kevin Powell on YouTubeWatch on YouTube

SaveMark complete

Sign in to save videos and track what you’ve finished.

IntermediateWeb DesignUI4 min

About this video

Shows a CSS Grid technique for transitioning an element's height from 0 to auto, which CSS does not animate directly. It also demonstrates the same approach in an accordion example.

What you’ll learn

  • Animate an element's height from 0 to auto using CSS Grid
  • Apply the grid height transition to an accordion component