Style wordWrap Property
Examples
Allow long words to wrap to the next line:
document.getElementById("myDIV").style.wordWrap="break-word";
Try it Yourself »
Definition and Usage
The wordWrap property allows long words or URL addresses to wrap to the next line.
Browser Support
![]()
All mainstream browsers support the wordWrap property.
Syntax
Return the wordWrap property:
object.style.wordWrap
Set the wordWrap property:
object.style.wordWrap="normal|break-word|initial|inherit"
Property Values
| Value | Description |
|---|---|
| normal | Break words only at allowed break points (the browser keeps the default handling). |
| break-word | Break words inside long words or URL addresses. |
| initial | Set this property to its default value. Seeinitial。 |
| inherit | Inherit this property from the parent element. Seeinherit。 |
Technical Details
| Default Value: | normal |
|---|---|
| Return Value: | A string representing the word-wrap property of the element. |
| CSS Version | CSS3 |
Related Articles
CSS Reference:word-wrap property
Other Extensions
Style Object