Tailwind CSS 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; / 160px / |
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
Build modern projects using Bootstrap 5 and Contrast
Trying to create components and pages for a web app or website from
scratch while maintaining a modern User interface can be very tedious.
This is why we created Contrast, to help drastically reduce the amount of time we spend doing that.
so we can focus on building some other aspects of the project.
Contrast Bootstrap PRO consists of a Premium UI Kit Library featuring over 10000+ component variants.
Which even comes bundled together with its own admin template comprising of 5 admin dashboards and 23+ additional admin and multipurpose pages for
building almost any type of website or web app.
See a demo and learn more about Contrast Bootstrap Pro by clicking here.