Home > database >  Tailwind align with Flex (Top, Center, Bottom)
Tailwind align with Flex (Top, Center, Bottom)

Time:12-10

I would like to build the following in a container using tailwind. Unfortunately I haven't found a good solution yet. Maybe someone knows more.

enter image description here

  <div >
        <div >1</div>
        <div >2</div>
        <div >3</div>
  </div>

In the div heading1 one should be at top, heading2 center and heading3 at bottom.

CodePudding user response:

You should use 'flex-col' class.

 <div >
      <div >Heading 1</div>
      <div >Heading 2</div>
      <div >Heading 3</div>
  </div>

Demo: https://play.tailwindcss.com/hDdf1puPXP?size=1260x720

CodePudding user response:

This is my proposition with flex flex-col items-center justify-center and custom bg-[colors] and a little white space (padding ,margin). Built with tailwindcss

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <script src="https://cdn.tailwindcss.com"></script>
  </head>

  <body >
    <div
      
    >
      <div >Heading1</div>
      <div >Heading2</div>
      <div >Heading3</div>
    </div>
  </body>
</html>

  • Related