Allow long words to be able to break and wrap onto the next line:
document.getElementById("myDIV").style.wordWrap = "break-word";
Try it Yourself »
The wordWrap property allows long words to be able to be broken and wrap onto the next line.
Property | |||||
---|---|---|---|---|---|
wordWrap | Yes | Yes | Yes | Yes | Yes |
Return the wordWrap property:
object.style.wordWrap
Set the wordWrap property:
object.style.wordWrap = "normal|break-word|initial|inherit"
Value | Description |
---|---|
normal | Break words only at allowed break points |
break-word | Allows unbreakable words to be broken |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |
Default Value: | normal |
---|---|
Return Value: | A String, representing the word-wrap property of an element |
CSS Version | CSS3 |
CSS reference: word-wrap property
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!