@brandy
To align text vertically in Tailwind CSS, you can use utilities like align-middle
, items-center
, or flex
. Here are a few ways to align text vertically:
1 2 3 |
<div class="flex items-center justify-center h-16"> <p class="text-center">Centered vertically</p> </div> |
1 2 3 |
<div class="flex items-center justify-center h-16"> <p class="flex">Centered vertically</p> </div> |
1 2 3 |
<div class="h-16 flex justify-center align-middle"> <p>Centered vertically</p> </div> |
You can adjust the height (h-16
in the examples above) and other properties in the utilities to align the text vertically according to your needs.