CSS Word Breaking: overflow-wrap & hyphens

Published:
16 Oct 2025
Updated:
02 Apr 2026

Long words or URLs can break your layout — especially on mobile. CSS offers three properties to control this behaviour.

The Solution

p {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

What Each Property Does

overflow-wrap: break-word

Allows the browser to break a word at any character if it does not fit on one line. It activates only as a last resort — normal wrapping is still preferred.

word-break: normal

Keeps default word-breaking behaviour. Use break-all only for code blocks or data tables — for regular text normal is the correct choice.

hyphens: auto

Automatically inserts hyphens when breaking words, based on language rules. Requires the correct lang attribute on your <html> element — e.g. lang="de" for German or lang="sk" for Slovak.

Apply to Multiple Elements

p, h1, h2, h3, h4 {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
}

Pro Tips

  • Set the correct lang on <html> — hyphenation depends on it.
  • Avoid word-break: break-all for prose — it breaks mid-word unnecessarily.
  • Test on your target languages — hyphens: auto support varies by browser.
Matus Trgina
- Founder of Shapeusto

Get it done.

Pause or cancel any time

If you don't need our services, there's no reason to pay. Just pause your subscription.

48 hour average delivery

We work incredibly fast. We can create most tasks within 48 hours.

Unlimited requests

Simply enter the number of tasks you need to solve, and we'll take care of all of them.

Unlimited users

An unlimited number of team members can add tasks to us.

Pause or cancel anytime

If you don't need our services, there's no reason to pay. Just pause your subscription.

48 hour average delivery

We work incredibly fast. We can create most tasks within 48 hours.

Unlimited users

An unlimited number of team members can add tasks to us.

Unlimited requests

Simply enter the number of tasks you need to solve, and we'll take care of all of them.
Headquartered in European Union, Slovak Republic
© 2026 Shapeusto. All rights reserved