Tailwind CSS Letter-spacing
The letter-spacing
utility class in Tailwind CSS allows you to adjust the spacing between characters in text. With Tailwind's letter-spacing class, you can increase or decrease the spacing between letters to achieve the desired typography style.
Applying Letter Spacing
To apply letter spacing to an element, you can use the tracking-{amount} utility class, where {amount} represents the spacing value.
- tracking-tighter: Applies tighter letter spacing.
- tracking-tight: Applies tight letter spacing.
- tracking-normal: Applies normal letter spacing.
- tracking-wide: Applies wide letter spacing.
- tracking-wider: Applies even wider letter spacing.
- tracking-widest: Applies the widest letter spacing.
<div class="tracking-tighter"> Lorem ipsum dolor sit amet.</div><div class="tracking-widest"> Lorem ipsum dolor sit amet.</div>
Preview
Responsive Letter Spacing
Tailwind CSS allows you to apply letter spacing classes responsively at different breakpoints. To use responsive letter spacing classes, you can append the breakpoint prefix to the utility class. For example, md:tracking-wide applies wider letter spacing starting from the medium breakpoint and above.
<p class="tracking-normal md:tracking-wide"> Lorem ipsum dolor sit amet.</p>
In the above example, the letter spacing is set to normal by default (tracking-normal), but starting from the medium breakpoint and above, the letter spacing is changed to wider (md:tracking-wide).
Tailwind Letter Spacing Class Table
Class | Properties |
---|---|
tracking-tighter | letter-spacing: -0.05em; |
tracking-tight | letter-spacing: -0.025em; |
tracking-normal | letter-spacing: 0em; |
tracking-wide | letter-spacing: 0.025em; |
tracking-wider | letter-spacing: 0.05em; |
tracking-widest | letter-spacing: 0.1em; |
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.