5

We have a span text inside a div element with taillwindcss, what's is the best way to align the text vertically with the div ?

<div class="h-64 w-64 flex flex-col align-items justify-center">
   <span>Home</span>
</div>
ksav
  • 20,015
  • 6
  • 46
  • 66
Raphael Mansuy
  • 213
  • 1
  • 4
  • 10
  • You cannot change the span HTML? This is the documentation: https://tailwindcss.com/docs/vertical-align – m4n0 Sep 14 '20 at 10:38
  • You just need to change class for vertical alignment. Please remove `align-items` and use `items-center` instead. For quick reference for classes, you can always use tailwind cheat-sheet. https://tailwindcomponents.com/cheatsheet/ – Rhythm Ruparelia Sep 14 '20 at 10:45

1 Answers1

11

<link href="https://www.unpkg.com/tailwindcss@1.9.6/dist/tailwind.min.css" rel="stylesheet">
<div class="h-64 w-64 flex flex-col justify-center items-center">
  <span>Home</span>
</div>
ksav
  • 20,015
  • 6
  • 46
  • 66