Style wordBreak attribute
- Previous Page width
- Next Page wordSpacing
- Go to the Previous Level HTML DOM Style Object
Definition and usage
wordBreak
This attribute specifies the line break rules for non-CJK scripts.
Note:CJK scripts are Chinese, Japanese, and Korean ("CJK") scripts.
See also:
CSS Reference Manual:word-break Attribute
Example
Break words between any two letters:
document.getElementById("myDIV").style.wordBreak = "break-all";
Syntax
Return the wordBreak attribute:
object.style.wordBreak
Set the wordBreak attribute:
object.style.wordBreak = "normal|break-all|keep-all|initial|inherit"
Attribute value
Value | Description |
---|---|
normal | Default value. Break words according to the usual rules. |
break-all | Line breaks can occur between any two letters. |
keep-all | Prohibit line breaks between letter pairs. |
initial | Set this attribute to its default value. Please refer to initial. |
inherit | This attribute inherits from its parent element. Please refer to inherit. |
Technical details
Default value: | normal |
---|---|
Return value: | A string that represents the element's word-break Attribute. |
CSS Version: | CSS3 |
Browser Support
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
Support | Support | Support | Support | Support |
- Previous Page width
- Next Page wordSpacing
- Go to the Previous Level HTML DOM Style Object