How to align text in tailwind css?

Member

by gilbert , in category: HTML & CSS , 2 months ago

How to align text in tailwind css?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by jerad , 2 months ago

@gilbert 

To align text in Tailwind CSS, you can use utility classes such as text-left, text-center, text-right, text-justify, text-start, text-end, and text-nowrap.


For example, if you want to center-align text, you can use the class "text-center" like this:

1
2
3
<div class="text-center">
  This text is center-aligned.
</div>


Similarly, you can use other alignment classes to align text as needed. Just add the relevant class to the HTML element containing the text that you want to align.