How to Suggest Hyphenation in HTML and CSS

How to Suggest Hyphenation in HTML and CSS

by Heinz Tschabitscher | May 20, 2026 | Useful Tech

Struggling with awkward line breaks on your website or words spilling out of their assigned containers? Trying to make a headline look good and balanced typographically? Find out here how to suggest hyphenation in HTML and CSS ⤓.

How to Suggest Hyphenation for Better Typography in HTML and CSS

Time needed: 1 minute

To mark a potential line breaking point for hyphenation in a word using HTML:

  1. Use the HTML entity &​shy; where you want to suggest a location for potential hyphenation in a word.

    Here’s what this means: When hyphenation is not disabled, the browser can break the word at this point if the line would otherwise be too long for its container.
    Here’s what it looks like: If the line is broken, a hyphen will be inserted at the breaking point; otherwise, nothing is displayed (the soft hyphen character &​shy; is not shown).
    Line still not breaking: If a line still does not break where suggested, a CSS rule may prevent it (see below) — or the browser does not support hyphenation.

  2. Insert <wbr /> to mark a potential line breaking point where no hyphen should be inserted even if the line is broken.

    Here’s where: This is useful in long URLs, for example, where the hyphen would be confusing and it is amply clear that the address is continued on the next line (e.g., using a different typeface).

  3. Insert a hyphen - to mark a hyphen (and potential line breaking point) that is always visible.

    HTML code: You can type out the hyphen as &​hyphen; in HTML.
    No-break hyphen: You can also insert a non-breaking hyphen in HTML to ensure the line will not break, of course.

From low-phen to hy-phen…

Buy La De Du a tea

Tips help fuel these email and tech how-tos.

Interaction with the “hyphens” CSS Property

The CSS property “hyphens” controls how the browser deals with line breaking and hyphenation (unless “word-break” overrules it; see below). Its three possible values are “manual” (the default), “none” and “auto”.

manualWords break only where hyphenation is suggested; otherwise, lines break at whitespace.
Hyphenation can be suggested with hyphen, soft hyphen and <wbr />.
noneWords do not break even if hyphenation is suggested; lines break only at whitespace.
Soft hyphens and <wbr /> remain invisible, and hyphens display mid-word while the line continues.
autoWords break at hyphenation points suggested by the browser’s hyphenation dictionary for the language unless a hyphenation point is manually suggested in the word; otherwise, lines break at whitespace.
One or more soft hyphens, hyphens or <wbr /> will turn off automatic hyphenation for the word. The word only breaks at one of the suggested points.

The “word-break” property: Note that two possible values for “word-break” will overrule hyphenation:

break-allWords will break where they would overflow their container regardless of “hyphens” and hyphenation suggestions.
keep-allWords will never break regardless of “hyphens” and hyphenation suggestions.

Browsers do differ in their interpretation of which word-breaking suggestions to take and follow, though.
Their word: MDN have information on the hyphens: CSS property.

Still something askew? How to Mirror Unicode Symbols Using CSS

HTML and CSS Hyphenation Suggestions Example (“Hyphens”)

hyphens: manual;
The word I propose is mi­surable, a blend of “measurable,” of course, and “miserable”.
hyphens: none;
The word I propose is mi­surable, a blend of “measurable,” of course, and “miserable”.
hyphens: auto;
The word I propose is mi­surable, a blend of “measurable,” of course, and “miserable”.

HTML and CSS Source Code

<dl>
  <dt><code>hyphens: manual;</code></dt>
  <dd style="hyphens: manual; width: 225px; border: 1px solid #327a7a">
    The word I propose is <em>mi&shy;surable</em>, a blend of “measurable,” of course, and “miserable”.
  </dd>
  <dt><code>hyphens: none;</code></dt>
  <dd style="hyphens: none; width: 225px; border: 1px solid #327a7a">
    The word I propose is <em>mi&shy;surable</em>, a blend of “measurable,” of course, and “miserable”.
  </dd>
  <dt><code>hyphens: auto;</code></dt>
  <dd style="hyphens: auto; width: 225px; border: 1px solid #327a7a">
    The word I propose is <em>mi&shy;surable</em>, a blend of “measurable,” of course, and “miserable”.
  </dd>
</dl>

HTML and CSS Hyphenation Suggestions Example (“Word-Break”)

word-break:keep-all;
https://ladedu.com/how-to-suggest-hyphenation-in-html-and-css/
word-break:break-all;
https://ladedu.com/how-to-suggest-hyphenation-in-html-and-css/
word-break:normal;
https://ladedu.com/how-to-suggest-hyphenation-in-html-and-css/

HTML and CSS Source Code

<dl>
  <dt><code>word-break:keep-all;</code></dt>
  <dd style="word-break:keep-all; width: 225px; border: 1px solid #327a7a">
    https://ladedu.com<wbr />/how-to-suggest-hyphenation-in-html-and-css/
  </dd>
  <dt><code>word-break:break-all;</code></dt>
  <dd style="word-break:break-all; width: 225px; border: 1px solid #327a7a">
    https://ladedu.com<wbr />/how-to-suggest-hyphenation-in-html-and-css/
  </dd>
  <dt><code>word-break:normal;</code></dt>
  <dd style="word-break:normal; width: 225px; border: 1px solid #327a7a">
    https://ladedu.com<wbr />/how-to-suggest-hyphenation-in-html-and-css/
  </dd>
</dl>

How to Suggest Hyphenation in HTML and CSS: FAQ

Why is the hyphenation suggestion called &shy; in HTML?

“Shy” stands for “soft hyphen”; the Unicode character U+00AD that corresponds to it is also called “soft hyphen”.

How can I prevent hyphenation for a word?

To stop browsers from hyphenating a single word (even when a block or page is set to hyphenating automatically):

  • Surround the word with <span style="hyphens: none;"> and </span> in HTML. code.
    Class: You can, of course, also set up a class for “hyphens:none” and apply that.
    Example: In Apple Notes for <span style="hyphens: none;">macOS</span>, you can link notes with…; this will prevent hyphenation of the word “macOS” (as “mac•OS”, for example).

Can I enable hyphenation for a complete page or section?

Yes.

You can apply the hyphens property to an entire page, or to paragraphs as a standard, for example, using CSS.

body,
article {
	hyphens: auto;
}

This will apply hyphenation as a standard for the entire body of the page or the self-contained article.

p {
	hyphens: auto;
}

Using this CSS rule will apply hyphenation to all paragraphs (p) by default.

(First published November 2024, last updated May 2026)

Home » Useful Tech » How to Suggest Hyphenation in HTML and CSS