.expanding-div { width: 200px; overflow: hidden; max-height: 0; /* Initial max height */ transition: max-height 0.5s ease; /* Animation transition property */ border: 1px solid #ccc; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); } .expanding-div:hover { max-height: 500px; /* Adjust the max height as needed */ }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter