CSS word-break attribute

Definition and usage

The word-break property specifies the method of automatic line breaking.

Tip:By using the word-break property, browsers can implement line breaks at any position.

Example

Line breaks at appropriate hyphenation points:

p.test {word-break:hyphenate;}

Try it yourself

CSS syntax

word-break: normal|break-all|keep-all;

Attribute value

Value Description
normal Use the browser's default line-breaking rules.
break-all Allow line breaks within words.
keep-all Only line breaks are allowed at half-width spaces or hyphens.

Technical details

Default value: normal
Inheritance: yes
Version: CSS3
JavaScript syntax: object.style.wordBreak="keep-all"

Browser support

The numbers in the table indicate the first browser version that fully supports this attribute.

Chrome IE / Edge Firefox Safari Opera
4.0 5.5 15.0 3.1 15.0