Skip to main content

Tailwind CSS Hyphens Cheatsheet

Complete reference for Tailwind v4 hyphens utilities.
Click any class to copy it to your clipboard.

Important: The lang Attribute

For hyphens-auto to work, you must set the lang attribute on the element or one of its ancestors. Without it, the browser cannot determine the appropriate hyphenation rules.

Without lang attribute

<p class="hyphens-auto">
  Internationalization
</p>
<!-- Hyphenation may not work -->

With lang attribute

<p class="hyphens-auto" lang="en">
  Internationalization
</p>
<!-- Hyphenation works correctly -->

Tip: You can set lang="en" on your <html> tag to enable hyphenation globally.

hyphens: none;

Words will never be hyphenated, even if they contain soft hyphens (&shy;). Long words will overflow or break depending on other word-break settings.

Long Word (English)

Internationalization

Long German Word

Donaudampfschifffahrtsgesellschaftskapitan

Paragraph Text

Internationalization and localization are essential considerations for modern web applications. These processes ensure that software can be adapted for different languages and regions without engineering changes.

With Soft Hyphens (&shy;)

Super­cali­fragilistic­expi­ali­docious

Ignores soft hyphens, no breaks

hyphens: manual;

Words only break at soft hyphens (&shy;) or the hyphen-minus character (-). This is the browser default behavior.

Long Word (English)

Internationalization

Long German Word

Donaudampfschifffahrtsgesellschaftskapitan

Paragraph Text

Internationalization and localization are essential considerations for modern web applications. These processes ensure that software can be adapted for different languages and regions without engineering changes.

With Soft Hyphens (&shy;)

Super­cali­fragilistic­expi­ali­docious

Breaks only at soft hyphen positions

hyphens: auto;

The browser automatically inserts hyphens at appropriate syllable breaks when words wrap. Requires the lang attribute (e.g., lang="en") to work properly.

Long Word (English)

Internationalization

Long German Word

Donaudampfschifffahrtsgesellschaftskapitan

Paragraph Text

Internationalization and localization are essential considerations for modern web applications. These processes ensure that software can be adapted for different languages and regions without engineering changes.

Side-by-Side Comparison

See how each hyphens utility handles the same long word in a narrow container.

hyphens-none

Internationalization

hyphens-manual

Internationalization

hyphens-auto

Internationalization

Common Use Cases

Justified Text Columns

<article lang="en">
  <p class="hyphens-auto text-justify
     max-w-prose">
    Long form content with
    justified alignment...
  </p>
</article>

Use hyphens-auto with justified text to avoid large gaps between words.

Narrow Sidebar Content

<aside class="w-48" lang="en">
  <p class="hyphens-auto">
    Content in narrow columns
    benefits from hyphenation
  </p>
</aside>

Narrow containers often need hyphenation to prevent awkward line breaks.

Code and Technical Content

<code class="hyphens-none">
  getServerSideProps
</code>

Use hyphens-none for code, brand names, and technical terms that should never be hyphenated.

Controlled Hyphenation Points

<p class="hyphens-manual">
  Anti&shy;dis&shy;establishment
</p>

Use hyphens-manual with &shy; for precise control over break points.

Quick Reference Table

ClassCSS PropertyBehavior
hyphens-nonehyphens: none;Never hyphenate, even at soft hyphens
hyphens-manualhyphens: manual;Only at explicit soft hyphens (&shy;)
hyphens-autohyphens: auto;Automatic (requires lang attribute)

Frequently Asked Questions

What is the difference between hyphens-auto and hyphens-manual?

hyphens-auto automatically inserts hyphens at appropriate syllable breaks when words wrap, using language-specific rules. hyphens-manual only breaks words where you've explicitly added soft hyphens (&shy;) in your HTML. Use hyphens-auto for general content and hyphens-manual when you need precise control over hyphenation points.

Why doesn't hyphens-auto work on my page?

The most common reason is a missing lang attribute. The browser needs to know the language to apply correct hyphenation rules. Add lang="en" (or your content language) to the element or its parent. Also ensure your container is narrow enough to trigger word wrapping.

Which browsers support CSS hyphens?

CSS hyphens is supported in all modern browsers including Chrome, Firefox, Safari, and Edge. However, hyphenation dictionary support varies by browser and language. English hyphenation works well across all browsers.

Should I use hyphens-auto with text-justify?

Yes! hyphens-auto and text-justify work great together. Justified text can create large gaps between words, especially in narrow columns. Automatic hyphenation fills these gaps by breaking long words, creating a more polished appearance.

How do I add a soft hyphen in HTML?

Use the HTML entity &shy; (soft hyphen) or the Unicode character U+00AD. For example: 'super&shy;cali&shy;fragilistic' will only show hyphens if the word breaks at those points. This works with hyphens-manual and hyphens-auto.

About Hyphens Utilities

Tailwind's hyphens utilities control how words are hyphenated when they wrap to the next line. This is especially useful for narrow text columns, justified text, and internationalized content.

Related utilities include word-break classes for controlling how words break, and overflow-wrap for handling long strings.

Combine with responsive prefixes for different behavior at different screen sizes:hyphens-none md:hyphens-auto