CSS word-wrap Property

Description

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

Initial value
normal
Applies to
All elements
Inherited
Yes
Media
Visual
Computed value
Specified value
Animatable
No
CSS Version
CSS3
JavaScript syntax
object.style.wordWrap

Syntax

Formal syntax: normal | break-word 

word-wrap: normal;
word-wrap: break-word;

Values

  • normalLines can only be broken at normal break points (spaces, non-alphanumeric characters, etc.).
  • break-wordWords that exceed the width of the container will be arbitrarily broken to fit within the containers bounds.
  • inherit

Example

.class {
   word-wrap: break-word;
}

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
5.512????
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
??????