Example
Break words between any two letters:
document.getElementById("myDIV").style.wordBreak = "break-all";
Try it Yourself »
Definition and Usage
The wordBreak property specifies line breaking rules for non-CJK scripts.
Tip: CJK scripts are Chinese, Japanese and Korean ("CJK") scripts.
Browser Support
The wordBreak property is supported in all major browsers.
Syntax
Return the wordBreak property:
object.style.wordBreak
Set the wordBreak property:
object.style.wordBreak="normal|break-all|keep-all|initial|inherit"
Property Values
Value | Description |
---|---|
normal | Default value. Break words according to their usual rules |
break-all | Lines may break between any two letters |
keep-all | Breaks are prohibited between pairs of letters |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Technical Details
Default Value: | normal |
---|---|
Return Value: | A String, representing the word-break property of an element |
CSS Version | CSS3 |
Related Pages
CSS reference: word-break property
< Style Object