Dynamic Height Tailwind CSS [Scroll]

Viewed 2098

have been working on this for a long time, and still stuck. I had to ask for help at last. https://play.tailwindcss.com/daNoTjnFDQ So here I want the div at line 3 to scroll and not the parent one. Have spent hours on this and couldn't figure out. Seems like the div needs some height but how can it be dynamic. Thank you

1 Answers

You will need to add max-h-** overflow-y-scroll to the div.

  <main class="bg-gray-100 rounded-tl-3xl pl-8 h-screen">
    <div class="mx-auto py-8 pr-8 max-h-96 overflow-y-scroll bg-red-100">
Related