CSS overflow-wrap Property
Example
Let the browser be allowed to break lines with long words, if they overflow the container:
div {
overflow-wrap: break-word;
}
Try it Yourself »
Definition and Usage
The overflow-wrap
property specifies whether
or not the browser can break lines with long words, if they overflow the container.
Default value: | normal |
---|---|
Inherited: | yes |
Animatable: | no. Read about animatable |
Version: | CSS3 |
JavaScript syntax: | object.style.overflowWrap="normal" Try it |
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
Property | |||||
---|---|---|---|---|---|
overflow-wrap | 23.0 | 18.0 | 49.0 | 6.1 | 12.1 |
CSS Syntax
overflow-wrap: normal|anywhere|break-word|initial|inherit;
Property Values
Value | Description | Demo |
---|---|---|
normal | Long words will not break, even if they overflow the container. This is default | Demo ❯ |
anywhere | Long words will break if they overflow the container | Demo ❯ |
break-word | Long words will break if they overflow the container | Demo ❯ |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
Related Pages
CSS tutorial: CSS Overflow