text-spacing-trim
Limited availability74% of usersExperimental
A modern property that helps manage the spacing between characters in CJK (Chinese, Japanese, Korean) typography. It specifically handles how 'half-width' punctuation and characters should be spaced to keep the layout looking clean.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyComingNot in Firefox or Safari yet, so not every major browser supports it.
The old way and the modern waySee the snippet: CJK and quote spacing without manual kerning →
Old way 13 lines
.prose p:first-letter {
margin-inline-start: -.25em;
}
.prose p {
text-indent: -.25em;
padding-inline-start: .25em;
}
.prose q::before {
margin-inline-start: -.2em;
}
.prose q::after {
margin-inline-end: -.2em;
}Modern 3 lines
.prose {
text-spacing-trim: trim-start;
}See how modern your own CSS is.Check your CSS →
Quick facts
- Initial value
normal- Inherited
- Yes
- Applies to
- text elements
- Animation type
- discrete
Quick example
article.cjk-text {
/* Trims the extra space from the start of the first line for a cleaner edge */
text-spacing-trim: trim-start;
}Values
space-allnormalspace-firsttrim-starttext-spacing-trim browser support
BaselineLimited availabilityThis feature is not Baseline because it does not work in some of the most widely-used browsers.Not ready for production without a fallback.
Usage74%of people can use this26% use a browser without it.
Browsers
123+
123+Mobile
123+Android