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).
<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.
<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
Class | Properties |
---|---|
indent-0 | text-indent: 0px; |
indent-px | text-indent: 1px; |
indent-0.5 | text-indent: 0.125rem; /_ 2px _/ |
indent-1 | text-indent: 0.25rem; /_ 4px _/ |
indent-1.5 | text-indent: 0.375rem; /_ 6px _/ |
indent-2 | text-indent: 0.5rem; /_ 8px _/ |
indent-2.5 | text-indent: 0.625rem; /_ 10px _/ |
indent-3 | text-indent: 0.75rem; /_ 12px _/ |
indent-3.5 | text-indent: 0.875rem; /_ 14px _/ |
indent-4 | text-indent: 1rem; /_ 16px _/ |
indent-5 | text-indent: 1.25rem; /_ 20px _/ |
indent-6 | text-indent: 1.5rem; /_ 24px _/ |
indent-7 | text-indent: 1.75rem; /_ 28px _/ |
indent-8 | text-indent: 2rem; /_ 32px _/ |
indent-9 | text-indent: 2.25rem; /_ 36px _/ |
indent-10 | text-indent: 2.5rem; /_ 40px _/ |
indent-11 | text-indent: 2.75rem; /_ 44px _/ |
indent-12 | text-indent: 3rem; /_ 48px _/ |
indent-14 | text-indent: 3.5rem; /_ 56px _/ |
indent-16 | text-indent: 4rem; /_ 64px _/ |
indent-20 | text-indent: 5rem; /_ 80px _/ |
indent-24 | text-indent: 6rem; /_ 96px _/ |
indent-28 | text-indent: 7rem; /_ 112px _/ |
indent-32 | text-indent: 8rem; /_ 128px _/ |
indent-36 | text-indent: 9rem; /_ 144px _/ |
indent-40 | text-indent: 10rem; /_ 160p _/ |
indent-44 | text-indent: 11rem; /_ 176px _/ |
indent-48 | text-indent: 12rem; /_ 192px _/ |
indent-52 | text-indent: 13rem; /_ 208px _/ |
indent-56 | text-indent: 14rem; /_ 224px _/ |
indent-60 | text-indent: 15rem; /_ 240px _/ |
indent-64 | text-indent: 16rem; /_ 256px _/ |
indent-72 | text-indent: 18rem; /_ 288px _/ |
indent-80 | text-indent: 20rem; /_ 320px _/ |
indent-96 | text-indent: 24rem; /_ 384px _/ |
Windframe Tailwind blocks
Windframe is a drag and drop builder for rapidly building tailwind css websites and UIs