Style wordBreak Property

Style 对象参考手册Style Object

Examples

Break line between any two letters:

document.getElementById("myDIV").style.wordBreak="break-all";

Try it Yourself »

Definition and Usage

The wordBreak property specifies the line-breaking rules for non-CJK languages.

Tip:CJK languages refer to Chinese, Japanese, and Korean.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

All major browsers support the wordBreak property.


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. Uses the browser's default line-breaking rules.
break-all Allows line breaks between any two letters within a word.
keep-all  Line breaks can only occur at half-width spaces or hyphens.
initial Sets this property to its default value. Seeinitial。
inherit Inherits this property from its parent element. Seeinherit。

Technical Details

Default Value: normal
Return Value: A string representing the element's word-break property.
CSS Version CSS3


Related Articles

CSS Reference Manual:word-break property


Style 对象参考手册Style Object

Other Extensions