DEV Community

Discussion on: Tailwind: Flex Col Justify Between Middle Full Height/Width?

Collapse
 
chingaipe profile image
Alick Chinga

Have you tried to remove the specified height you have on the main tag - h-64 and change flex to flex-1 or flex-auto on the main tag

Collapse
 
dendihandian profile image
Dendi Handian • Edited
<div class="min-h-screen flex-auto flex-col justify-between">
  <header class="p-4 bg-teal-500 text-center text-white font-bold">Header</header>
  <main class="bg-teal-600 flex items-center justify-center text-white">Main</main>
  <footer class="p-4 bg-teal-500 text-center text-white font-bold">Footer</footer>
</div>
Enter fullscreen mode Exit fullscreen mode

It doesn't cover the screen height but Douglas' answer seems right. But Thanks for your answer!

Collapse
 
chingaipe profile image
Alick Chinga

You need to put the flex-auto or flex-grow class as in Douglas's answer.