English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

CSS Reference Manual

CSS @rules (RULES)

Complete List of CSS Attributes

CSS3 word-size attribute

word-Break attribute usage and example

The break CSS attribute is used to specify how to wrap within words.

The following table provides usage instructions and version history for this attribute, as well as its usage syntax in JavaScript scripts.normal
Default value:Applicable to:
All elementsInheritance:
YesCan be animated:No. Animation properties.
Version: CSS3new feature
JavaScript syntax:object.style.wordBreak="break-all"

word-break usage syntax

The syntax of this attribute is as follows:

word-break: normal | break-all | keep-all  | initial | inherit

The following examples demonstrate how to use word-break attribute.

  p {
   width: 150px;
   background: #90ee90;
   word-break: break-all;
  }
Test and see‹/›

Attribute values

The following table describes the values of this attribute.

ValueDescription
normalWords are wrapped according to their usual rules.
break-allAllow wrapping within words.
keep-allPrevent spaces between paired letters. Can only be wrapped at half-width spaces or hyphens.
initialSet this property to its default value.
inheritIf specified, the associated elements will adopt the word of their parent element.-Break attribute values.

Browser compatibility

word-Browser compatibility of the break attribute; the numbers in the table below indicate the minimum browser version that supports this attribute; all mainstream browsers support this attribute.

  • Firefox 15+

  • Google Chrome4+

  • Internet Explorer 5.5Above

  • Apple Safari 3.1+

  • Opera 15+

Read more

Please refer to the following tutorials:CSS Text.

Related properties:word-wrap,white-space,text-overflow.