XML technologies / CSS / Advanced websites with CSS / CSS property reference / word-wrap

(Excerpt from “CSS − Advanced websites with Cascading Stylesheets” by Rachel Andrew & Dan Shafer)

The property word-wrap, which is not included in the CSS specification, controls words longer than the width (width) of their containing element. They either overflow the width or wrap onto the next line.

Inherited: yes

See also: width, text-overflow

Values

  • break-word (wraps the word onto the next line)

  • normal (allows content to overflow the box)

Default value: normal

Compatibility

CSS version: not part of the CSS specification

Works only in Internet Explorer for Windows, version 5.5 and later.

Example

The following style rule wraps long words when they exceed the width of their containing element:

body {
 word-wrap: break-word;
}

  

 

 

 

back to top