Line height is one of those things that can make or break your design. Too tight and your text feels cramped and hard to read. Too loose and it looks disconnected, like each line is floating away from the others.
The good news is that Tailwind CSS gives you full control over line height with simple utility classes. No need to write custom CSS or guess what values look good – everything is built in and ready to use.
In this guide I'll show you exactly how to work with line height in Tailwind CSS, from the basics to some newer features that make life a lot easier.
If you've worked with Tailwind before, you've probably seen classes like leading-normal or leading-tight and wondered why they're called "leading" instead of "line-height".
The term comes from traditional typography. Back in the days of metal typesetting, printers would add thin strips of lead between lines of text to increase spacing. That's where we get the word "leading" (pronounced "ledding").
In Tailwind, the leading-* prefix controls line height. Here's the basic syntax:
<div class='max-w-2xl mx-auto space-y-6 p-6'>
<div class='bg-white rounded-lg border border-gray-200 p-4'>
<p class='text-sm text-gray-500 mb-2 font-medium'>leading-tight (1.25)</p>
<p class='leading-tight text-gray-700'>
This text has a tight line height. Notice how the lines are closer together. This works great for headlines where you want a compact, impactful look. But it can feel cramped for longer paragraphs.
</p>
</div>
<div class='bg-white rounded-lg border border-gray-200 p-4'>
<p class='text-sm text-gray-500 mb-2 font-medium'>leading-normal (1.5)</p>
<p class='leading-normal text-gray-700'>
This text has normal line height. It's the default in most browsers and provides a good balance between compactness and readability. This is what you'll use most often for body text.
</p>
</div>
<div class='bg-white rounded-lg border border-gray-200 p-4'>
<p class='text-sm text-gray-500 mb-2 font-medium'>leading-loose (2)</p>
<p class='leading-loose text-gray-700'>
This text has a loose line height. See how much breathing room there is between lines? This can improve readability for some types of content but can also make text feel disconnected.
</p>
</div>
</div>You can also use the modern slash notation to combine font size and line height in one class:
<div class='max-w-2xl mx-auto space-y-4 p-6'>
<p class='text-sm/6 text-gray-700 bg-blue-50 p-3 rounded'>
This uses text-sm/6 which sets both font size and line height together
</p>
<p class='text-lg/7 text-gray-700 bg-green-50 p-3 rounded'>
This uses text-lg/7 for a larger font with proportional line height
</p>
</div>This is cleaner and easier to read than applying two separate classes.
Here's something that confuses a lot of people when they first start using Tailwind's line height utilities – there are actually two different types of values, and they behave very differently.
Relative values (unitless numbers) scale with your font size. If you make your text bigger, the line height automatically adjusts proportionally.
Fixed values (rem-based) stay the same no matter what font size you use. They give you precise control over vertical spacing.
Let me show you what I mean:
<div class='max-w-3xl mx-auto space-y-8 p-6'>
<div class='bg-gradient-to-r from-blue-50 to-indigo-50 rounded-xl p-6'>
<h3 class='text-lg font-semibold text-gray-800 mb-4'>Relative Values (Scale with Font Size)</h3>
<div class='space-y-4'>
<div class='bg-white rounded-lg p-4 border-l-4 border-blue-500'>
<p class='text-xs text-gray-500 mb-1'>text-sm leading-normal</p>
<p class='text-sm leading-normal text-gray-700'>
This uses a relative value so when the font size changes, the line height scales proportionally. Great for maintaining consistent visual rhythm across different text sizes.
</p>
</div>
<div class='bg-white rounded-lg p-4 border-l-4 border-blue-500'>
<p class='text-xs text-gray-500 mb-1'>text-xl leading-normal</p>
<p class='text-xl leading-normal text-gray-700'>
Same leading-normal class but bigger font. Notice how the spacing between lines grew with the text size.
</p>
</div>
</div>
</div>
<div class='bg-gradient-to-r from-green-50 to-emerald-50 rounded-xl p-6'>
<h3 class='text-lg font-semibold text-gray-800 mb-4'>Fixed Values (Stay Consistent)</h3>
<div class='space-y-4'>
<div class='bg-white rounded-lg p-4 border-l-4 border-green-500'>
<p class='text-xs text-gray-500 mb-1'>text-sm leading-6</p>
<p class='text-sm leading-6 text-gray-700'>
This uses leading-6 which is always 1.5rem. The line spacing stays exactly the same regardless of font size. Perfect for layouts that need precise vertical alignment.
</p>
</div>
<div class='bg-white rounded-lg p-4 border-l-4 border-green-500'>
<p class='text-xs text-gray-500 mb-1'>text-xl leading-6</p>
<p class='text-xl leading-6 text-gray-700'>
Same leading-6 but bigger text. The line height did not grow with the font size.
</p>
</div>
</div>
</div>
</div>So when should you use each type?
Use relative values (leading-normal, leading-tight, etc.) when:
Use fixed values (leading-6, leading-7, etc.) when:
Here's a practical example. Say you're building a card component:
<div class='max-w-md mx-auto p-6'>
<div class='bg-white rounded-lg shadow-lg p-6 border border-gray-200'>
<h3 class='text-2xl leading-tight mb-2 text-gray-900'>Product Features</h3>
<p class='text-base leading-relaxed text-gray-600'>
Notice how the title uses leading-tight for impact while the description uses leading-relaxed for easy reading. This creates nice visual hierarchy.
</p>
</div>
</div>The title uses leading-tight to keep it compact and punchy. The description uses leading-relaxed for better readability. Both are relative values, so they'll scale nicely if you ever need to adjust font sizes.
Sometimes the default Tailwind values just don't cut it. Maybe your designer gave you exact specs, or maybe you need something between leading-normal and leading-relaxed.
That's where arbitrary values come in handy. You can create one-off custom line heights using square bracket notation:
<div class='max-w-2xl mx-auto space-y-6 p-6'>
<div class='bg-white rounded-lg border-2 border-purple-200 p-5'>
<p class='text-sm text-purple-600 font-medium mb-2'>leading-[1.15]</p>
<p class='text-lg leading-[1.15] text-gray-800'>
This text uses a custom unitless value of 1.15 that sits between leading-none (1) and leading-tight (1.25). Perfect for when you need something just a bit tighter than the defaults.
</p>
</div>
<div class='bg-white rounded-lg border-2 border-blue-200 p-5'>
<p class='text-sm text-blue-600 font-medium mb-2'>leading-[2.5rem]</p>
<p class='text-lg leading-[2.5rem] text-gray-800'>
This uses a fixed rem value. No matter what the font size is, the line height stays at exactly 2.5rem. Great for precise layouts.
</p>
</div>
<div class='bg-white rounded-lg border-2 border-green-200 p-5'>
<p class='text-sm text-green-600 font-medium mb-2'>leading-[40px]</p>
<p class='text-lg leading-[40px] text-gray-800'>
You can even use pixel values if that's what your design requires. Though rem values are usually better for accessibility.
</p>
</div>
</div>If you find yourself using the same custom value multiple times, it makes sense to add it to your Tailwind configuration instead.
For Tailwind CSS v3, you'd update your tailwind.config.js:
<div class='max-w-2xl mx-auto p-6'>
<div class='bg-gray-900 rounded-lg p-6 text-gray-100 font-mono text-sm'>
<div class='text-purple-400'>module.exports = {</div>
<div class='ml-4 text-blue-300'>theme: {</div>
<div class='ml-8 text-blue-300'>extend: {</div>
<div class='ml-12 text-green-300'>lineHeight: {</div>
<div class='ml-16 text-yellow-200'><span class='text-orange-300'>'extra-tight'</span>: <span class='text-green-300'>'1.15'</span>,</div>
<div class='ml-16 text-yellow-200'><span class='text-orange-300'>'extra-loose'</span>: <span class='text-green-300'>'2.5'</span>,</div>
<div class='ml-12 text-green-300'>}</div>
<div class='ml-8 text-blue-300'>}</div>
<div class='ml-4 text-blue-300'>}</div>
<div class='text-purple-400'>}</div>
</div>
</div>Now you can use leading-extra-tight and leading-extra-loose anywhere in your project.
For Tailwind CSS v4, the approach is different. You use the new @theme directive in your CSS:
<div class='max-w-2xl mx-auto p-6 space-y-4'>
<div class='bg-gradient-to-br from-indigo-50 to-purple-50 rounded-lg p-6 border-2 border-indigo-200'>
<p class='text-sm text-indigo-600 font-semibold mb-3'>Tailwind v4 Approach</p>
<div class='bg-gray-900 rounded p-4 text-gray-100 font-mono text-sm'>
<div class='text-pink-400'>@theme {</div>
<div class='ml-4 text-blue-300'>--line-height-extra-tight: 1.15;</div>
<div class='ml-4 text-blue-300'>--line-height-extra-loose: 2.5;</div>
<div class='text-pink-400'>}</div>
</div>
</div>
<p class='text-sm text-gray-600 bg-white rounded-lg p-4 border border-gray-200'>
The v4 approach uses CSS custom properties directly, which is more modern and doesn't require a JavaScript config file. Much cleaner!
</p>
</div>The v4 approach is cleaner because everything lives in your CSS file instead of having a separate JavaScript config. Plus it follows modern CSS patterns with custom properties.
This is honestly one of my favorite new features in Tailwind CSS v4. If you've ever tried to align icons next to text, you know the pain – you end up with weird spacing, icons that sit too high or too low, and tons of trial and error.
The 1lh unit solves this completely. It represents exactly the height of one line of text at the current line height. So no matter what your text size or line height is, your icon will always be perfectly sized.
Let me show you the difference:
<div class='max-w-3xl mx-auto space-y-8 p-6'>
<div class='bg-red-50 rounded-xl p-6 border-2 border-red-200'>
<h3 class='text-lg font-semibold text-red-800 mb-4'>Without 1lh (Fixed Height)</h3>
<ul class='space-y-3'>
<li class='flex gap-3 items-start text-base leading-relaxed'>
<svg class='size-5 text-red-600 flex-shrink-0' fill='currentColor' viewBox='0 0 20 20'>
<path fill-rule='evenodd' d='M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z' clip-rule='evenodd'/>
</svg>
<span class='text-gray-700'>Icon height is fixed at 20px regardless of line height</span>
</li>
<li class='flex gap-3 items-start text-xl leading-loose'>
<svg class='size-5 text-red-600 flex-shrink-0' fill='currentColor' viewBox='0 0 20 20'>
<path fill-rule='evenodd' d='M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z' clip-rule='evenodd'/>
</svg>
<span class='text-gray-700'>Same icon size but larger text makes it look tiny and misaligned</span>
</li>
</ul>
</div>
<div class='bg-green-50 rounded-xl p-6 border-2 border-green-200'>
<h3 class='text-lg font-semibold text-green-800 mb-4'>With 1lh (Responsive Height)</h3>
<ul class='space-y-3'>
<li class='flex gap-3 items-start text-base leading-relaxed'>
<svg class='h-[1lh] w-5 text-green-600 flex-shrink-0' fill='currentColor' viewBox='0 0 20 20'>
<path fill-rule='evenodd' d='M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z' clip-rule='evenodd'/>
</svg>
<span class='text-gray-700'>Icon height matches the line height automatically</span>
</li>
<li class='flex gap-3 items-start text-xl leading-loose'>
<svg class='h-[1lh] w-5 text-green-600 flex-shrink-0' fill='currentColor' viewBox='0 0 20 20'>
<path fill-rule='evenodd' d='M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z' clip-rule='evenodd'/>
</svg>
<span class='text-gray-700'>Larger text means larger icon, perfect alignment every time</span>
</li>
</ul>
</div>
</div>See the difference? The 1lh version automatically scales with your text size and line height. Change the font size or line height and the icon adjusts automatically.
This is perfect for feature lists, navigation items, and any place where you have icons alongside text:
<div class='max-w-2xl mx-auto p-6'>
<div class='bg-white rounded-xl shadow-lg p-6 border border-gray-200'>
<h2 class='text-2xl font-bold text-gray-900 mb-6'>Premium Features</h2>
<ul class='space-y-5'>
<li class='flex gap-4 items-start'>
<svg class='h-[1lh] w-6 text-blue-500 flex-shrink-0' fill='currentColor' viewBox='0 0 20 20'>
<path fill-rule='evenodd' d='M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z' clip-rule='evenodd'/>
</svg>
<div>
<h3 class='font-semibold text-gray-900 leading-snug'>Unlimited projects</h3>
<p class='text-sm text-gray-600 leading-relaxed'>Create as many projects as you need without any restrictions</p>
</div>
</li>
<li class='flex gap-4 items-start'>
<svg class='h-[1lh] w-6 text-blue-500 flex-shrink-0' fill='currentColor' viewBox='0 0 20 20'>
<path fill-rule='evenodd' d='M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z' clip-rule='evenodd'/>
</svg>
<div>
<h3 class='font-semibold text-gray-900 leading-snug'>Advanced analytics</h3>
<p class='text-sm text-gray-600 leading-relaxed'>Get detailed insights into your project performance and user behavior</p>
</div>
</li>
<li class='flex gap-4 items-start'>
<svg class='h-[1lh] w-6 text-blue-500 flex-shrink-0' fill='currentColor' viewBox='0 0 20 20'>
<path fill-rule='evenodd' d='M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z' clip-rule='evenodd'/>
</svg>
<div>
<h3 class='font-semibold text-gray-900 leading-snug'>Priority support</h3>
<p class='text-sm text-gray-600 leading-relaxed'>Get help when you need it with our dedicated support team</p>
</div>
</li>
</ul>
</div>
</div>Notice how the icons align perfectly with the first line of each feature, even though the headings and descriptions have different line heights. That's the magic of 1lh.
Before this unit existed, you'd have to use complex flexbox alignment tricks or calculate exact pixel values. Now it just works.
Getting line height right isn't just about making things look good – it directly impacts how easy your content is to read. Let me share some practical guidelines.
For body text, stick between 1.5 and 2. This is actually an accessibility requirement too. WCAG (Web Content Accessibility Guidelines) recommends a minimum line height of 1.5 for paragraph text. That's why leading-normal (1.5) is such a safe default.
<div class='max-w-3xl mx-auto space-y-6 p-6'>
<div class='bg-green-50 rounded-xl p-6 border-2 border-green-300'>
<p class='text-sm text-green-700 font-semibold mb-3'>Good: leading-relaxed (1.625)</p>
<p class='text-base leading-relaxed text-gray-800'>
This paragraph uses leading-relaxed which gives the text plenty of breathing room. Each line is clearly separated from the next, making it easy for your eyes to track from one line to another. This is perfect for long-form content like blog posts or documentation where readability is the top priority.
</p>
</div>
<div class='bg-yellow-50 rounded-xl p-6 border-2 border-yellow-300'>
<p class='text-sm text-yellow-700 font-semibold mb-3'>Okay: leading-normal (1.5)</p>
<p class='text-base leading-normal text-gray-800'>
This paragraph uses leading-normal which is the minimum recommended for accessibility. It works fine for most content and is a solid default choice. You get decent readability without taking up too much vertical space on the page.
</p>
</div>
<div class='bg-red-50 rounded-xl p-6 border-2 border-red-300'>
<p class='text-sm text-red-700 font-semibold mb-3'>Bad: leading-tight (1.25)</p>
<p class='text-base leading-tight text-gray-800'>
This paragraph uses leading-tight and you can probably feel the difference. The lines are packed together which makes it harder to read, especially for longer paragraphs. Your eyes can easily jump to the wrong line. This is fine for headlines but avoid it for body text.
</p>
</div>
</div>Headlines are different. For large text like headings, you actually want tighter line height. Otherwise the lines feel disconnected. Use leading-tight (1.25) or even leading-none (1) for big, bold headlines.
<div class='max-w-3xl mx-auto space-y-8 p-6'>
<div class='bg-white rounded-lg p-6 border border-gray-200'>
<p class='text-xs text-green-600 font-medium mb-3'>Good: leading-tight</p>
<h2 class='text-4xl font-bold text-gray-900 leading-tight'>
This Headline Looks Professional and Cohesive
</h2>
</div>
<div class='bg-white rounded-lg p-6 border border-gray-200'>
<p class='text-xs text-red-600 font-medium mb-3'>Bad: leading-loose</p>
<h2 class='text-4xl font-bold text-gray-900 leading-loose'>
This Headline Feels Disconnected and Awkward
</h2>
</div>
</div>Create visual hierarchy by mixing line heights. Use tight spacing for titles and looser spacing for body text. This helps readers understand what's important at a glance.
Here's a real-world example putting it all together:
<article class='max-w-2xl mx-auto p-6 bg-white'>
<h1 class='text-4xl font-bold leading-tight mb-4 text-gray-900'>
The Complete Guide to Modern Web Design
</h1>
<p class='text-lg leading-relaxed text-gray-600 mb-8'>
Learn the fundamental principles that make websites both beautiful and functional
</p>
<div class='space-y-6'>
<div>
<h2 class='text-2xl font-semibold leading-tight mb-3 text-gray-900'>
Typography Matters
</h2>
<p class='leading-relaxed text-gray-800 mb-4'>
Good typography is invisible. When done right, readers don't notice the font choices or spacing – they just enjoy reading your content. The goal is to make text as easy to consume as possible.
</p>
<p class='leading-relaxed text-gray-800'>
Line height plays a huge role in this. Too tight and words feel cramped. Too loose and sentences fall apart. Finding the sweet spot makes all the difference.
</p>
</div>
<div>
<h2 class='text-2xl font-semibold leading-tight mb-3 text-gray-900'>
Start With Good Defaults
</h2>
<p class='leading-relaxed text-gray-800'>
Rather than reinventing the wheel, start with proven values like leading-normal for body text and leading-tight for headings. You can always fine-tune later, but these defaults work great for most projects.
</p>
</div>
</div>
</article>Notice how the tight headlines create impact while the relaxed body text stays comfortable to read. That's the sweet spot.
A couple more quick tips:
The key is testing your content with real users and adjusting based on feedback. What looks good on your design mockup might feel different when someone's actually trying to read it.
That's everything you need to know about controlling line height in Tailwind CSS. From the basics of leading-* classes to advanced features like the 1lh unit, you now have all the tools to create perfectly spaced typography.
Start with the defaults, experiment with custom values when needed, and always keep readability front and center. Your users will thank you for it.
Get notified when we add new templates, components, and more!
WindyBase Make development a breezeWindyBase is a weekly curated Tailwind CSS template and tool directory built for the modern developer.
© 2026 WindyBase. All rights reserved.