X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Style wordWrap Property

Style Object Reference Style Object

Example

Allow long words to be able to break and wrap onto the next line:

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

Try it yourself »


Definition and Usage

The wordWrap property allows long words to be able to be broken and wrap onto the next line.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The wordWrap property is supported in all major browsers.


Syntax

Return the wordWrap property:

object.style.wordWrap

Set the wordWrap property:

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

Property Values

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

Technical Details

Default Value: normal
Return Value: A String, representing the word-wrap property of an element
CSS Version CSS3


Related Pages

CSS reference: word-wrap property


Style Object Reference Style Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook