text-spacing-trim
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The text-spacing-trim CSS property controls the internal spacing set on Chinese/Japanese/Korean (CJK) punctuation characters between adjacent characters (kerning) and at the start or end of text lines.
Browser support
| Feature | Desktop | Mobile | ||||
|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Safari | Chrome Android | Safari iOS | |
text-spacing-trim Experimental | 123 | 123 | | | 123 | |
normal Experimental | 123 | 123 | | | 123 | |
space-all Experimental | 123 | 123 | | | 123 | |
space-first Experimental | 123 | 123 | | | 123 | |
trim-start Experimental | 123 | 123 | | | 123 | |
1+Supported (version) Not supported ※Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)
Syntax
CSS
.japanese-text {
text-spacing-trim: space-all;
} Live demo
Use cases
-
Use text-spacing-trim
Use text-spacing-trim when the default CSS behavior is not expressive enough for the component or layout you are building.
-
Handle edge cases
Apply text-spacing-trim to solve a specific styling constraint without introducing broader layout or behavior changes.
Cautions
- Test text-spacing-trim in the browsers you support, especially if it changes layout, text handling, or interaction behavior.
- Plan a fallback or acceptable degradation path when support is still limited.
Accessibility
- Confirm that using text-spacing-trim does not make content harder to perceive, understand, or operate in assistive contexts.