<script src="https://cdn.tailwindcss.com"></script>
<div class="h-screen grid grid-rows-[auto,1fr]">
<div class="bg-slate-300 h-24 flex items-center px-4">
<h1 class="text-3xl">Navbar</h1>
</div>
<div class="p-4 gap-2 grid grid-rows-[auto,1fr]">
<h1 class="text-3xl">Title</h1>
<div class="gap-4 grid grid-rows-[auto,1fr]">
<div class="flex">
<button class="btn border rounded p-2">Button</button>
</div>
<div class="overflow-y-auto flex flex-col gap-2">
<div class="h-[200px] bg-slate-100"></div>
<div class="h-[200px] bg-slate-100"></div>
<div class="h-[200px] bg-slate-100"></div>
<div class="h-[200px] bg-slate-100"></div>
<div class="h-[200px] bg-slate-100"></div>
<div class="h-[200px] bg-slate-100"></div>
<div class="h-[200px] bg-slate-100"></div>
<div class="h-[200px] bg-slate-100"></div>
</div>
</div>
</div>
</div>
The div
with class overflow-y-auto
should be scrollable, but it's not behaving as expected. Setting a fixed height for the div
will make it scrollable, but I want it to take up the remaining space within its parent container.