CSS overflow-wrap property

Definition and Usage

overflow-wrap The property specifies whether the browser can break the line when a long word overflows the container.

Example

Allows the browser to wrap long words if they overflow the container:

div {
  overflow-wrap: break-word;
}

Try It Yourself

CSS Syntax

overflow-wrap: normal|anywhere|break-word|initial|inherit;

Property Value

Value Description
normal Long words do not break the line, even if they overflow the container. Default value.
anywhere Breaks the line if a long word overflows the container.
break-word Breaks the line if a long word overflows the container.
initial Sets this property to its default value. See: initial.
inherit Inherits this property from its parent element. See: inherit.

Technical Details

Default Value: normal
Inheritance: Yes
Animation Production: Not supported. See:Animation-related Properties.
Version: CSS3
JavaScript Syntax: object.style.overflowWrap="normal"

Browser Support

The numbers in the table represent the browser version that first fully supports this property.

Chrome Edge Firefox Safari Opera
23.0 18.0 49.0 6.1 12.1

Related Pages

Tutorial:CSS Overflow