Last updated: 9 May 2024

Tailwind CSS Text Indent

The text-indent utility class in Tailwind CSS allows you to control the indentation of text within an element.


Tailwind Text Indent

The text-indent utility class in Tailwind CSS allows you to control the indentation of text within an element. With Tailwind's text-indent class, you can easily apply left indentation to paragraphs, lists, or any other text content.

Applying Text Indent

To apply text indentation to an element, you can use the indent-{value} utility class, where {value} represents the desired indentation value. The {value} can be a fixed number or a relative length. Here are some examples:

  • indent-0: No indentation (default).
  • indent-4: Indentation of 4 units (e.g., 1rem or 16px).
  • indent-8: Indentation of 2rem.
  • indent-16: Indentation of 4rem (64px).
html
<p class="indent-16">
Far away, on a secluded beach, the waves crashed against the shore, creating a soothing rhythm.
The sand, warm beneath my toes, embraced me like an old friend. Seagulls soared gracefully
overhead, their cries mingling with the laughter of children building sandcastles.
</p>

Preview

Far away, on a secluded beach, the waves crashed against the shore, creating a soothing rhythm. The sand, warm beneath my toes, embraced me like an old friend. Seagulls soared gracefully overhead, their cries mingling with the laughter of children building sandcastles.

Responsive Text Indent

Tailwind CSS allows you to apply text indentation classes responsively at different breakpoints. To use responsive text indentation classes, you can append the breakpoint prefix to the utility class. For example, md:indent-8 applies an indentation of 8 units starting from the medium breakpoint and above.

html
<p class="indent-4 md:indent-8">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</p>

In the above example, the paragraph has a left indentation of 4 units by default (text-indent-4), but starting from the medium breakpoint and above, the indentation is increased to 8 units (md:text-indent-8).

Tailwind Text Indent Class Table

ClassProperties
indent-0text-indent: 0px;
indent-pxtext-indent: 1px;
indent-0.5text-indent: 0.125rem; /_ 2px _/
indent-1text-indent: 0.25rem; /_ 4px _/
indent-1.5text-indent: 0.375rem; /_ 6px _/
indent-2text-indent: 0.5rem; /_ 8px _/
indent-2.5text-indent: 0.625rem; /_ 10px _/
indent-3text-indent: 0.75rem; /_ 12px _/
indent-3.5text-indent: 0.875rem; /_ 14px _/
indent-4text-indent: 1rem; /_ 16px _/
indent-5text-indent: 1.25rem; /_ 20px _/
indent-6text-indent: 1.5rem; /_ 24px _/
indent-7text-indent: 1.75rem; /_ 28px _/
indent-8text-indent: 2rem; /_ 32px _/
indent-9text-indent: 2.25rem; /_ 36px _/
indent-10text-indent: 2.5rem; /_ 40px _/
indent-11text-indent: 2.75rem; /_ 44px _/
indent-12text-indent: 3rem; /_ 48px _/
indent-14text-indent: 3.5rem; /_ 56px _/
indent-16text-indent: 4rem; /_ 64px _/
indent-20text-indent: 5rem; /_ 80px _/
indent-24text-indent: 6rem; /_ 96px _/
indent-28text-indent: 7rem; /_ 112px _/
indent-32text-indent: 8rem; /_ 128px _/
indent-36text-indent: 9rem; /_ 144px _/
indent-40text-indent: 10rem; /_ 160p _/
indent-44text-indent: 11rem; /_ 176px _/
indent-48text-indent: 12rem; /_ 192px _/
indent-52text-indent: 13rem; /_ 208px _/
indent-56text-indent: 14rem; /_ 224px _/
indent-60text-indent: 15rem; /_ 240px _/
indent-64text-indent: 16rem; /_ 256px _/
indent-72text-indent: 18rem; /_ 288px _/
indent-80text-indent: 20rem; /_ 320px _/
indent-96text-indent: 24rem; /_ 384px _/

Windframe Tailwind blocks

Landing page

Windframe is a drag and drop builder for rapidly building tailwind css websites and UIs

Start building stunning tailwind UIs! 

Build from scratch or select prebuilt tailwind templates