CSS word-break Property
Example
Break words at any character:
p.a {
word-break: break-all;
}
Try it Yourself »
Definition and Usage
The word-break
property specifies how words
should break when reaching the end of a line.
Show demo ❯
Default value: |
normal |
Inherited: |
yes |
Animatable: |
no. Read about animatable |
Version: |
CSS3 |
JavaScript syntax: |
object.style.wordBreak="break-all"
Try it
|
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
Property |
|
|
|
|
|
word-break |
4.0 |
5.5 |
15.0 |
3.1 |
15.0 |
CSS Syntax
word-break: normal|break-all|keep-all|break-word|initial|inherit;
Property Values
Value |
Description |
Demo |
normal |
Default value. Uses default line breaking rules |
|
break-all |
To prevent overflow, word may be broken at any character |
Demo ❯ |
keep-all |
Prevents words from breaking, except for CJK (Chinese, Japanese, Korean)
text, where it behaves like normal |
Demo ❯ |
break-word |
Deprecated. Replaced by
overflow-wrap: break-word; |
Demo ❯ |
initial |
Sets this property to its default value. Read about initial |
|
inherit |
Inherits this property from its parent element. Read about inherit |
|