This feature is not Baseline because it does not work in some of the most widely-used browsers.
The text-autospace CSS property allows you to specify the space applied between Chinese/Japanese/Korean (CJK) and non-CJK characters.
text-autospace: normal; text-autospace: no-autospace; text-autospace: ideograph-alpha; text-autospace: ideograph-numeric; text-autospace: punctuation; text-autospace: insert; text-autospace: replace; text-autospace: ideograph-alpha ideograph-numeric punctuation; text-autospace: ideograph-alpha ideograph-numeric; text-autospace: ideograph-alpha ideograph-numeric insert; text-autospace: auto; /* Global values */ text-autospace: inherit; text-autospace: initial; text-autospace: revert; text-autospace: revert-layer; text-autospace: unset;
normalCreates the default behavior to automatically apply spacing between CJK and non-CJK characters and around punctuation. This value has the same effect as applying both ideograph-alpha and ideograph-numeric.
<autospace>Provides more control over spacing behaviors. It accepts:
no-autospace, orideograph-alpha, ideograph-numeric, and punctuation, optionally followed by insert or replace.no-autospace ideograph-alpha ideograph-numeric punctuation insert replace autoLets the browser choose typographically appropriate spacing. The spacing may vary across browsers and platforms.
Note: If neither insert nor replace are specified, the behavior is the same as insert.
Note: This property is additive with the word-spacing and letter-spacing properties. The amount of spacing contributed by the letter-spacing setting is added to the spacing created by text-autospace. The same applies to word-spacing.
text-autospace =
normal |
<autospace> |
auto
<autospace> =
no-autospace |
[ ideograph-alpha || ideograph-numeric || punctuation ] || [ insert | replace ]
This example shows the difference between various values of text-autospace. Try selecting a value from the drop-down box to see how it affects the spacing in the text.
<main>
<figure class="no-autospace">
<figcaption>
<code>
text-autospace: <span id="autospace-value">no-autospace</span>;
</code>
</figcaption>
<div>
<p>HTML超文本标记语言</p>
<p>42四十二</p>
</div>
</figure>
</main>
.no-autospace {
text-autospace: no-autospace;
}
.auto {
text-autospace: auto;
}
.normal {
text-autospace: normal;
}
.ideograph-alpha {
text-autospace: ideograph-alpha;
}
.ideograph-numeric {
text-autospace: ideograph-numeric;
}
| Specification |
|---|
| CSS Text Module Level 4> # propdef-text-autospace> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
text-autospace |
140 | 140 | previewThe property parses, but has no effect. |
124 | 18.4 | 140 | No | No | 18.4 | No | 140 | 18.4 |
auto |
No | No | preview | No | 18.4 | No | No | No | 18.4 | No | No | 18.4 |
ideograph-alpha |
No | No | preview | No | 18.4 | No | No | No | 18.4 | No | No | 18.4 |
ideograph-numeric |
No | No | preview | No | 18.4 | No | No | No | 18.4 | No | No | 18.4 |
insert |
No | No | preview | No | 18.4 | No | No | No | 18.4 | No | No | 18.4 |
no-autospace |
140 | 140 | preview | 124 | 18.4 | 140 | No | No | 18.4 | No | 140 | 18.4 |
normal |
140 | 140 | preview | 124 | 18.4 | 140 | No | No | 18.4 | No | 140 | 18.4 |
punctuation |
140 | 140 | preview | 124 | 18.4 | 140 | No | No | 18.4 | No | 140 | 18.4 |
replace |
140 | 140 | No | 124 | 18.4 | 140 | No | No | 18.4 | No | 140 | 18.4 |
text-spacing-trimic and ric units
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/CSS/text-autospace