CSS hyphens Property

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The hyphens property controls how words are hyphenated when text wraps to the next line. You can ban breaks, allow only suggested breaks, or let the browser choose.

It applies to all elements and is inherited. The initial value is manual. Automatic hyphenation needs a language (lang) and a dictionary the browser supports. Customize the visible mark with hyphenate-character.

Language matters for auto.

Browsers hyphenate with hyphens: auto only when a suitable lang is set and a hyphenation dictionary is available.

CSS Syntax

syntax.css
hyphens: none | manual | auto | initial | inherit;

Property Values

ValueDescriptionTry it
noneNo hyphenation. Wrap only at spacesTry it
manualDefault. Break only at soft or hard hyphensTry it
autoBrowser may hyphenate using language rulesTry it
initialResets to manualTry it
inheritTakes the parent’s hyphensTry it

Suggested breaks: soft hyphen ­ (invisible until needed) and hard hyphen ‐ (always visible).

How to Use hyphens

Choose a mode, set the language for auto, and make the line narrow enough to wrap.

  1. Set lang on the text or an ancestor (required for reliable auto).
  2. Pick none, manual, or auto.
  3. For manual, add soft hyphens where breaks are allowed.
  4. Optional: style the mark with hyphenate-character.
PieceRequired?Role
hyphens keywordYesnone, manual, or auto
langFor autoSelects the hyphenation dictionary
Soft hyphensFor predictable manualMark allowed break points in the HTML
Narrow widthTo see wrappingWide lines may never need a hyphen

Live Preview

Toggle modes on a narrow English word that includes soft hyphens.

Soft hyphens are in the sample. With none, the word may overflow the narrow box.

Word

An extreme­ly long English word

hyphens: auto

CSS Examples

Each snippet focuses on hyphens. Soft hyphens keep demos predictable. Use Try It Yourself for a live editor.

Example 1 — No Hyphenation

Disable hyphenation. The word wraps only at spaces.

CSS
<style>
  p {
    hyphens: none;
  }
</style>

<p lang="en">An extreme&shy;ly long English word</p>
Try It Yourself

How It Works

  1. Set none. Soft hyphens inside words are ignored for wrapping.
  2. Wrap at spaces only. Lines break between words, not mid-word.
  3. Overflow possible. A long word in a narrow box may stick out.
  4. Use when unbroken words matter. Good for IDs, URLs, or code-like text.

Example 2 — Manual Soft Hyphens

Break only where you place soft hyphens.

CSS
<style>
  p {
    hyphens: manual;
  }
</style>

<p lang="en">An extreme&shy;ly long English word</p>
Try It Yourself

How It Works

  1. Use manual. This is the default value.
  2. Mark break points. &shy; suggests where a hyphen may appear.
  3. Invisible until needed. If the line fits, no hyphen is shown.
  4. You stay in control. The browser will not invent other break points.

Example 3 — Automatic Hyphenation

Let the browser choose hyphenation points for the language.

CSS
<style>
  p {
    hyphens: auto;
  }
</style>

<p lang="en">An extraordinarily long English word</p>
Try It Yourself

How It Works

  1. Set auto. The browser may insert hyphens using language rules.
  2. Include lang. lang="en" selects English hyphenation.
  3. Soft hyphens still win. If present, suggested breaks override automatic ones.
  4. Results vary. Dictionaries differ by browser and language.

Edge Cases & Pitfalls

If nothing hyphenates, check language, width, and other wrap settings.

lang

auto needs a language

Without lang (or with an unsupported language), automatic hyphenation may not run.

width

Wide lines hide the effect

If every word fits, no wrap occurs and no hyphen appears.

break

word-break: break-all skips hyphens

With word-break: break-all, words can break without showing a hyphen mark.

wrap

No wrap means no hyphens

If wrapping is disabled (for example via white-space: nowrap), hyphenation has nowhere to act.

wbr

<wbr> breaks without a hyphen

A line break at <wbr> does not insert a hyphen character.

Browser Support

hyphens is a browser typography property. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Values vary by language

hyphens

none / manual / auto: Chrome 55+, Firefox 43+, Safari 17+, Edge 79+. Auto quality depends on language dictionaries.

95% Property support
Google Chrome 55+
Full
Mozilla Firefox 43+
Full
Apple Safari 17+
Full
Microsoft Edge 79+
Full
Opera 44+
Full
Samsung Internet 6.0+
Full
Internet Explorer Partial (prefix / limited)
Partial
hyphens Widely supported

Bottom line: Safe for modern sites. Prefer soft hyphens when you need exact break points; use auto for general body text with a correct lang.

Key Takeaways

  • Role: decide whether words may hyphenate when lines wrap.
  • Values: none, manual (default), auto.
  • Inherited: yes. Soft hyphens hint break points for manual.
  • For auto: set lang and expect dictionary differences across browsers.

One line: hyphens chooses none, only suggested breaks, or automatic language-based hyphenation.

Frequently Asked Questions

It controls whether words can break with a hyphen when text wraps: never (none), only at soft hyphens (manual), or automatically (auto).
The initial value is manual. Words break only where soft hyphens or hard hyphens suggest a break.
Usually the lang attribute is missing, the line is wide enough that no wrap is needed, or the browser lacks a hyphenation dictionary for that language.
A soft hyphen (&shy;) is an invisible break hint. It only shows a hyphen if the browser wraps at that point.
Yes. You can set it on a parent such as article or p and child text inherits it.
It is Baseline for common use: Chrome 55+, Firefox 43+, Safari 17+, Edge 79+. Language coverage for auto still varies. It is a browser typography property, not a Node.js feature.

Next: image-rendering

Learn how browsers scale images when resized.

image-rendering tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful