Word-wrap property

Last updated: 2026-09-13

word-wrap Word-wrap property

The word-wrap CSS property is an alias for overflow-wrap. It controls whether a long word or URL may break inside when it exceeds the container width. It was designed to prevent unbreakable long strings from overflowing the container and remains a common tool for text overflow; modern specs recommend overflow-wrap instead.

Category
Initial Valuenormal
InheritedYes
Applies To
Animation Type
CSS VersionCSS3
StatusStandard

📝 Syntax

word-wrap: normal | break-word;

⚙️ Values

ValueTypeDescription
normal | break-wordKeywordLong-word wrapping (alias for overflow-wrap)

▶ Example

Edit the code below and see the live result in the playground:

🌐 Browser Support

Browser ChromeChrome EdgeEdge FirefoxFirefox SafariSafari OperaOpera
word-wrap v10 v12 v1 v1 v10
Supported in all major browsers
Tip: word-wrap: break-word prefers to break at word boundaries and only breaks inside a word when a single word exceeds the container width.
Important: word-wrap is the historical alias of overflow-wrap and the two are exactly equivalent. Modern projects should use overflow-wrap to match the spec.

❓ FAQ

QIs there any difference between word-wrap and overflow-wrap?
ANone — they are fully equivalent. word-wrap was the non-standard name implemented by early browsers; it was later standardized and renamed overflow-wrap, but word-wrap is kept as an alias for backwards compatibility.
QWhat is the difference between word-wrap: break-word and word-break: break-all?
Aword-wrap: break-word keeps words as whole as possible and only breaks them when necessary; word-break: break-all forces a break at the container edge regardless of word integrity.
QHow do I handle URLs or long words overflowing the container?
AUse word-wrap: break-word (i.e. overflow-wrap: break-word). The browser prefers to break at word boundaries and only breaks inside a word when a single long word cannot fit — ideal for URLs, emails, and hash strings.

📚 Related Tutorials

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏