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 break rules
break-all To prevent overflow, word may be broken at any character Demo ❯
keep-all  Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as value "normal" Demo ❯
break-word To prevent overflow, word may be broken at arbitrary points Demo ❯
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit


Copyright 1999-2023 by Refsnes Data. All Rights Reserved.