word-wrap property CSS Reference



Definition and Usage

The word-wrap CSS property is used to specify whether or not the browser may break lines within words in order to prevent overflow when an otherwise unbreakable string is too long to fit in its containing box.

Note: Originally a Microsoft (unprefixed) proprietary extension, the word-wrap property has been renamed overflow-wrap in the current draft of the CSS3 Text specification. Stable builds of Google Chrome and Opera support the new syntax.

  • Initial normal
  • Applies to all elements
  • Inherited yes
  • Media visual
  • Computed Value as specified
  • Animatable no
  • Canonical order the unique non-ambiguous order defined by the formal grammar

Syntax

Formal syntax: normal | break-word
word-wrap: normal
word-wrap: break-word
word-wrap: inherit

Values

normal
Indicates that lines may only break at normal word break points.
break-word
Indicates that normally unbreakable words may be broken at arbitrary points if there are no otherwise acceptable break points in the line.

Examples

p { width: 13em; background: gold; }

At vero eos et accusamus et iusto odio dignissimos ducimusquiblanditiispraesentiumvoluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident

p { width: 13em; background: gold; word-wrap: break-word; }

At vero eos et accusamus et iusto odiodignissimosducimusquiblanditiispraesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident


Compatibility

Desktop browsers

FeatureFirefox (Gecko)ChromeInternet ExplorerOperaSafari
Basic support3.5 (1.9.1)1.05.510.51.0

Mobile browsers

FeatureFirefox Mobile (Gecko)AndroidIE MobileOpera MobileSafari Mobile
Basic support1.0 (1.9.1)1.0NANA1.0

Relative articles

Retro UI Kits