word-wrap is the legacy name for overflow-wrap. It remains a supported compatibility alias; it is not a separate wrapping algorithm or a universally removed deprecated property.
Read a legacy declaration
Break-word allows the long token to wrap when it would otherwise overflow. The narrow box makes that behavior visible.
HTML and CSS
HTML
<p class="token">workshopregistrationidentifierwithoutspaces</p>
CSS
.token {
max-width: 12rem;
word-wrap: break-word;
padding: 0.75rem;
background: #eff6ff;
}
Edit HTML or CSS to update the preview as you type. Copy code snippet copies the selected tab. Preview spacing and font defaults are not included.
Put a legacy fallback before a modern value
Because these names address the same property, source order matters. The modern anywhere declaration belongs last; reversing the order can replace it with break-word in browsers that recognize both.
HTML and CSS
HTML
<p class="token">anotherregistrationidentifierwithoutspaces</p>
CSS
.token {
max-width: 12rem;
word-wrap: break-word;
overflow-wrap: anywhere;
padding: 0.75rem;
background: #eff6ff;
}
Edit HTML or CSS to update the preview as you type. Copy code snippet copies the selected tab. Preview spacing and font defaults are not included.
Values and defaults
The initial value is normal and the property is inherited. The alias accepts the corresponding overflow-wrap values, including normal, break-word, and anywhere where supported. Normal retains language-appropriate ordinary breaking; it does not mean every long word always overflows regardless of existing break opportunities.
Anywhere and break-word differ during min-content sizing. Anywhere includes its emergency breaks in that calculation; break-word does not. Use overflow-wrap for the full explanation.
Migration without a behavior surprise
Prefer the modern name in new code. Keep the alias only when the target browser requirements justify it, and put a deliberate modern override after the fallback. White-space:nowrap can still prevent wrapping, and minimum box sizes can still force overflow.
The old practical example did not contain a token long enough to test its claim. Both examples here do. Learn white-space and min-width before assuming a wrapping declaration fixes every layout.
Sources and browser support
MDN: overflow-wrap describes the syntax and links to the specification and compatibility data. Check individual values in that table when supporting older browsers.