CKTIS / CSS
text-justify — text justification method
The text-justify property selects how spacing is distributed in a justified line. It does not enable justification itself: it needs an appropriate alignment, usually text-align: justify. Its methods distinguish spacing at word separators from spacing between typographic character units.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
text-justify: [ auto | none | inter-word | inter-character | ruby ] || no-compress;text-justify controls the justification method, not alignment. It affects lines aligned with justify; normally you also set text-align: justify. It is inherited, initially auto, and animates discretely. The last line is normally not justified; the example deliberately sets text-align-last: justify.
auto lets the browser choose an algorithm; an accurate lang attribute helps account for language. none disables justification. inter-word adjusts spacing only at word separators, whereas inter-character adjusts spacing between adjacent typographic character units, not arbitrary Unicode code points. The legacy distribute keyword is an alias that computes to inter-character.
The Level 4 draft adds ruby: behavior like auto, but without justification opportunities at word separators or between Bopomofo characters. It also adds no-compress, alone or with one method: this forbids compression of spacing controlled by text-spacing-trim and text-autospace, not all compression. The || notation allows either order and requires at least one component.
The specification does not guarantee identical pixel output across browsers. Draft syntax is not evidence of implementation support. Check both parsing and actual layout in the target version; the example has not been executed or verified in Chromium 152.
Examples
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>text-justify comparison</title>
<style>
p {
width: 240px;
font: 20px/1.5 monospace;
text-align: justify;
text-align-last: justify;
border: 1px solid;
}
.words { text-justify: inter-word; }
.characters { text-justify: inter-character; }
</style>
<p class="words">ONE TWO SIX</p>
<p class="characters">ONE TWO SIX</p>
</html>Result
In a browser that supports both values, the first line can expand spacing only at word separators, while the second can expand spacing between adjacent typographic character units. The browser may limit how much spacing it adds, so either line may fall short of the available width.
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.