Tailwind Letter Spacing

Tailwind letter spacing allows you to adjust the spacing between letters in text. In this article, we will explore Tailwind’s letter spacing with examples.

The letter spacing classes allow you to adjust the spacing between characters within an element.

Tailwind Letter Spacing

This can be helpful in enhancing readability or achieving a specific visual effect.

Tailwind offers predefined classes to adjust letter spacing.



What is Letter Spacing?

Letter spacing, also known as tracking, refers to the amount of space between characters in a text block.

This spacing can be adjusted to create various effects, such as improving readability, emphasizing text, or creating a unique design style. In traditional CSS, letter spacing is defined using the letter-spacing property, which takes a value in pixels, ems, or other units.


Tailwind Letter Spacing Classes

ClassesOverview
tracking-tighterThis class decreases the spacing between characters in an element by setting the letter-spacing to -0.05em.
tracking-tightBy setting the letter-spacing to -0.025em, this class decreases the space between characters in an element.
tracking-normalThe letter-spacing using this class is set to 0em. This is the default value.
tracking-wideThis class sets a value of 0.025em to the letter-spacing property, which increases the spacing between characters within an element.
tracking-widerIt increases the spacing between characters within an element by defining the letter-spacing property as 0.05em.
tracking-widestThe letter-spacing property is set to 0.1em, which increases the spacing between characters.

Syntax

<element class="tracking-{size}">...</element>

A brief example related to tracking-tighter, tracking-normal and tracking-wider classes is present below:

Example: 

<!DOCTYPE html> <html> <head> <script src="https://cdn.tailwindcss.com"></script> </head> <body class="text-center"> <h1 class="text-gray-600 text-2xl font-semibold"> MrExamples </h1> <p class="font-medium text-slate-800 my-3">Letter spacing in Tailwind</p> <div class="mx-24 bg-gray-200 p-2 rounded text-start font-medium"> <p class="m-2">tracking-tighter: <span class="tracking-tighter"> Learning through examples </span> </p> <p class="m-2">tracking-normal: <span class="tracking-normal"> Learning through examples </span> </p> <p class="m-2">tracking-wider: <span class="tracking-wider"> Learning through examples </span> </p> </div> </body> </html>
You can refer to the example below for a proper understanding of the tracking-tight, tracking-wide and tracking-widest classes in Tailwind:

Example: 

<!DOCTYPE html> <html> <head> <script src="https://cdn.tailwindcss.com"></script> </head> <body class="text-center"> <h1 class="text-gray-600 text-2xl font-semibold"> MrExamples </h1> <p class="font-medium text-slate-800 my-3">Letter spacing in Tailwind</p> <div class="mx-24 bg-gray-200 p-2 rounded text-start font-medium"> <p class="m-2">tracking-tight: <span class="tracking-tight"> Learning through examples </span> </p> <p class="m-2">tracking-wide: <span class="tracking-wide"> Learning through examples </span> </p> <p class="m-2">tracking-widest: <span class="tracking-widest"> Learning through examples </span> </p> </div> </body> </html>
We value your feedback.
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0

Subscribe To Our Newsletter
Enter your email to receive a weekly round-up of our best posts. Learn more!
icon

Leave a Reply

Your email address will not be published. Required fields are marked *