Set the justification method to "inter-word" when text-align is set to "justify":
div {
text-align: justify;
text-justify: inter-word;
}
Try it Yourself »
The text-justify
property specifies the justification method of text when text-align is set to "justify".
Default value: | auto |
---|---|
Inherited: | yes |
Animatable: | no. Read about animatable |
Version: | CSS3 |
JavaScript syntax: | object.style.textJustify="inter-word" |
The numbers in the table specify the first browser version that fully supports the property.
Property | |||||
---|---|---|---|---|---|
text-justify | Yes* | 11.0 | 55.0 | 10.0.3 | Yes* |
*This feature is behind the Enable Experimental Web Platform Features preference (needs to be set to Enabled). To change preferences in Chrome: type in "chrome://flags" in the Chrome browser. To change preferences in Opera: type in "flags" in the Opera browser.
text-justify: auto|inter-word|inter-character|none|initial|inherit;
Value | Description | Demo |
---|---|---|
auto | The browser determines the justification algorithm | Play it » |
inter-word | Increases/Decreases the space between words | Play it » |
inter-character | Increases/Decreases the space between characters | Play it » |
none | Disables justification methods | Play it » |
initial | Sets this property to its default value. Read about initial | Play it » |
inherit | Inherits this property from its parent element. Read about inherit |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!