Golang Tutorials - Learn Go Programming with Easy Step-by-Step Guides

Explore comprehensive Golang tutorials for beginners and advanced programmers. Learn Go programming with easy-to-follow, step-by-step guides, examples, and practical tips to master Go language quickly.

Line Height And Letter Spacing in TailwindCSS

Line Height And Letter Spacing in TailwindCSS

? Line Height and Letter Spacing in Tailwind CSS

Tailwind provides utilities to control line height (space between lines) and letter spacing (space between characters) for text styling.


1. Line Height (leading-*)

Controls the vertical space between lines of text.

ClassCSS EquivalentDescription
leading-noneline-height: 1;No extra spacing
leading-tightline-height: 1.25;Tight line height
leading-snugline-height: 1.375;Snug spacing
leading-normalline-height: 1.5;Normal (default)
leading-relaxedline-height: 1.625;Relaxed spacing
leading-looseline-height: 2;Loose (more spaced)

Example:

<p class="leading-tight">  This paragraph has tight line height, so lines are close together.</p><p class="leading-loose">  This paragraph has loose line height, so lines are more spaced out.</p>

2. Letter Spacing (tracking-*)

Controls horizontal spacing between letters (tracking).

ClassCSS EquivalentDescription
tracking-tighterletter-spacing: -0.05em;Tighter letter spacing
tracking-tightletter-spacing: -0.025em;Slightly tight spacing
tracking-normalletter-spacing: 0;Normal spacing (default)
tracking-wideletter-spacing: 0.025em;Slightly wider spacing
tracking-widerletter-spacing: 0.05em;Wider letter spacing
tracking-widestletter-spacing: 0.1em;Widest letter spacing

Example:

<p class="tracking-tight">  This text has tight letter spacing.</p><p class="tracking-widest">  This text has widest letter spacing.</p>

Combined Example

<p class="leading-relaxed tracking-wide text-lg">  This paragraph has relaxed line height and wide letter spacing.</p>

If you want, I can help with responsive line-height or letter-spacing or customizing these values in Tailwind config!

Disclaimer for AI-Generated Content:
The content provided in these tutorials is generated using artificial intelligence and is intended for educational purposes only.
html
docker
php
kubernetes
golang
mysql
postgresql
mariaDB
sql