Friday, October 10, 2025
HomejQueryJustify Textual content Heart, Proper, Backside

Justify Textual content Heart, Proper, Backside


Textual content Align Utilities in Tailwind CSS

As a way to management the alignment of textual content, you could use Tailwind align utility lessons for textual content.

These are:

  • text-left               text-align: left;
  • text-center         text-align: middle;
  • text-right             text-align: proper;
  • text-justify         text-align: justify;
  • text-start             text-align: begin;
  • text-end              text-align: finish;

Allow us to take a look at examples of utilizing these utility lessons in numerous HTML parts.

An instance of aligning textual content centrally in paragraphs

Allow us to begin our demos by aligning the textual content centrally in 5 paragraphs.

Within the paragraphs, we used background colours, width, margin, and text-center class. Moreover, we additionally used peak utilities in paragraphs to point out the place centrally textual content is positioned. Take a look:

tailwind-text-center

The code:

Align textual content proper instance

Within the instance beneath, the textual content within the paragraph is aligned proper through the use of the text-right Tailwind utility class.

Code:

Vertically and horizontally middle align textual content instance

Within the first instance, we noticed the textual content is aligned middle the place we used peak for the paragraphs.

Nevertheless, the textual content is aligned prime vertically.

What if we need to align textual content vertically and horizontally centered?

One of many methods could be utilizing the road peak utility lessons for the peak of parts.

Then utilizing the text-center class will make the textual content centered and center vertically.

See the answer and output beneath:

tailwind-center-vertical

Tailwind Code

The instance of utilizing Tailwind CSS textual content align in a desk

On this instance, we used textual content align lessons of Tailwind in an HTML desk.

In <th>, we used text-center utility class.

Within the first desk row with knowledge, we used text-right class. Within the second row, text-left class is used.

Within the final row, we used the text-start class.

tailwind-align-table

Code



 

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments