CSS Portal

CSS hyphens Property

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The hyphens property controls whether words may be automatically broken and hyphenated at line breaks. It is a typographic control that influences how text wraps within a container: when automatic hyphenation is enabled, the rendering engine can insert hyphenation points inside words according to language-specific rules and dictionaries, reducing uneven line endings and improving justification. Because hyphenation relies on linguistic rules, its behavior is sensitive to the text language and to the presence of explicit soft-hyphen characters in the text; those manual hints interact with the automatic process to allow or forbid specific break opportunities.

Hyphenation affects not only visual appearance but also layout metrics. Introducing hyphens changes where lines break, which can alter the height of a block, the distribution of white space, and the number of lines used. For narrow columns or fully justified text, allowing hyphenation often produces more even word spacing and fewer overly stretched or compressed spaces. However, excessive or poorly chosen hyphenation can harm readability, so hyphenation is typically balanced against other line-breaking and wrapping behaviors and typographic practices.

This property must be considered alongside other text-wrapping and line-breaking controls. For example, overflow-wrap determines whether long words may be broken to avoid overflow, while word-break changes the rules for breaking words at line boundaries; these interact with hyphenation decisions and together determine where breaks are allowed. In contexts with East Asian text, line-break rules affect acceptable break positions and can change how hyphenation is applied or whether it is appropriate at all. When designing readable, stable layouts, consider the combined effect of these properties, the language of the content, and any manual hyphenation hints embedded in the text.

Definition

Initial value
manual
Applies to
All elements
Inherited
Yes
Computed value
Specified value
Animatable
No
JavaScript syntax
object.style.hyphens

Interactive Demo

An extra­ordinarily long English word!

Syntax

hyphens: none | manual | auto 

Values

  • noneWords are not hyphenated, even if characters inside the word explicitly define hyphenation opportunities.
  • manualWords are only hyphenated where there are characters inside the word that explicitly suggest hyphenation opportunities.
  • autoThe browser is free to automatically break words at appropriate hyphenation points, following whatever rules it chooses to use.

Example

<div class="container">
<h1>CSS hyphens property - examples</h1>

<section class="example none">
<h2>hyphens: none</h2>
<p lang="en">A paragraph with a long word: antidisestablishmentarianism that cannot be hyphenated automatically when hyphens is set to none.</p>
</section>

<section class="example auto">
<h2>hyphens: auto</h2>
<p lang="en">A paragraph with a long word: antidisestablishmentarianism that may be hyphenated automatically when the browser and language support it.</p>
</section>

<section class="example manual">
<h2>hyphens: manual (soft hyphens)</h2>
<p lang="en">A paragraph with a soft-hyphenated word: anti&shy;dis&shy;establish&shy;ment&shy;ari&shy;an&shy;ism to force break points.</p>
</section>
</div>
/* Layout and base styles */
.container {
    max-width: 520px;
    margin: 24px auto;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    line-height: 1.5;
    color: #222;
}

h1 {
    font-size: 1.15rem;
    margin: 0 0 12px;
}

.example {
    padding: 12px 16px;
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    margin: 12px 0;
    background: #fff;
}

.example h2 {
    font-size: 0.95rem;
    margin: 0 0 8px;
    color: #333;
}

.example p {
    margin: 0;
    /* Keep the paragraph narrow so hyphenation can occur */
    font-size: 0.95rem;
}

/* Hyphens rules (with vendor prefixes) */
.example.none p {
    -webkit-hyphens: none;
    -ms-hyphens: none;
    hyphens: none;
}

.example.auto p {
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    hyphens: auto;
}

.example.manual p {
    -webkit-hyphens: manual;
    -ms-hyphens: manual;
    hyphens: manual;
}

/* Narrow the container a bit more on larger screens to force wrapping */
@media (min-width: 600px) {
    .container { max-width: 420px; }
}

Browser Support

The following information will show you the current browser support for the CSS hyphens property. Hover over a browser icon to see the version that first introduced support for this CSS property.

This property is supported by all modern browsers.
Desktop
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 1st January 2026

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!