Latest web development tutorials

HTML DOM Style wordWrap property

Style Object Reference Style Objects

Examples

Allow long word wrap to the next line:

document.getElementById("myDIV").style.wordWrap="break-word";

try it"

Definition and Usage

wordWrap property allows long words or URL address wrap to the next line.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support wordWrap property.


grammar

Back wordWrap properties:

object .style.wordWrap

Setting wordWrap properties:

object .style.wordWrap="normal|break-word|initial|inherit"

Property Value

描述
normal 只在允许的断字点换行(浏览器保持默认处理)。
break-word 在长单词或 URL 地址内部进行换行。
initial 设置该属性为它的默认值。请参阅 initial
inherit 从父元素继承该属性。请参阅 inherit

technical details

Defaults: normal
return value: String representing the word-wrap attribute element.
CSS version CSS3


related articles

CSS Reference Manual: Word-wrap property


Style Object Reference Style Objects