CSS hyphens Property
Example
Set different hyphenations:
div.a {
-webkit-hyphens: none;
-ms-hyphens: none;
hyphens: none;
}
div.b {
-webkit-hyphens: manual;
-ms-hyphens:
manual;
hyphens: manual;
}
div.c {
-webkit-hyphens:
auto;
-ms-hyphens: auto;
hyphens: auto;
}
Try it Yourself »
Definition and Usage
The hyphens
property defines whether
hyphenation is allowed to create more soft wrap opportunities within a line of
text.
Default value: | manual |
---|---|
Inherited: | yes |
Animatable: | no. Read about animatable |
Version: | CSS3 |
JavaScript syntax: | object.style.hyphens="none" |
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
Property | |||||
---|---|---|---|---|---|
hyphens | 55.0 | 10.0 -ms- | 43.0 | 5.1 -webkit- | 44.0 |
CSS Syntax
hyphens: none|manual|auto|initial|inherit;
Property Values
Value | Description |
---|---|
none | Words are not hyphenated |
manual | Default. Words are only hyphenated at ‐ or ­ (if needed) |
auto | Words are hyphenated where the algorithm is deciding (if needed) |
initial | Sets this property to its default value. Read about initial |
inherit | Inherits this property from its parent element. Read about inherit |