How to use justify-between vertically with tailwind?

by haylee.mertz , in category: HTML & CSS , 16 days ago

How to use justify-between vertically with tailwind?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by orpha , 16 days ago

@haylee.mertz 

To use justify-between vertically with Tailwind CSS, you can apply the justify-between class to the justify-items utility in your HTML markup. Here's an example:

1
2
3
4
5
<div class="flex flex-col justify-between h-full">
  <div class="bg-red-200">Item 1</div>
  <div class="bg-blue-200">Item 2</div>
  <div class="bg-green-200">Item 3</div>
</div>


In this example, the flex flex-col classes make the parent container a flex container that stacks its children vertically. Then, the justify-between class is used to evenly distribute the children vertically in the available space.


You can adjust the height of the parent container by adding the h-full class or any other height utility class provided by Tailwind CSS to achieve the desired layout.