CSS3 word-break
Property
Topic: CSS3 Properties ReferencePrev|Next
Description
The word-break
CSS property is used to specify how (or if) to break lines within words.
The following table summarizes the usages context and the version history of this property.
Default value: | normal |
---|---|
Applies to: | All elements |
Inherited: | Yes |
Animatable: | No. See animatable properties. |
Version: | New in CSS3 |
Syntax
The syntax of the property is given with:
The example below shows the word-break
property in action.
Example
Try this code »p {
width: 150px;
background: #90ee90;
word-break: break-all;
}
Property Values
The following table describes the values of this property.
Value | Description |
---|---|
normal |
Words break according to their usual rules. |
break-all |
Lines may break between any two letters. |
keep-all |
Breaks are prohibited between pairs of letters. |
initial |
Sets this property to its default value. |
inherit |
If specified, the associated element takes the computed value of its parent element word-break property. |
Browser Compatibility
The word-break
property is supported in all major modern browsers.
Basic Support—
|
Further Reading
See tutorial on: CSS Text.
Related properties: word-wrap
, white-space
, text-overflow
.