Skip to content
Tutorials Center
My learning

Topics

CSS Reference ยท Properties for Special Contexts

The text-combine-upright property

Reference for the CSS text-combine-upright property: fit several characters or digits into one upright cell inside vertical text, with examples and notes.

In vertical writing, each character normally gets its own line position. That makes a number like 2026 awkward: it either lies on its side or stacks four narrow digits. text-combine-upright squeezes a short run of characters into the space of one character cell, set upright, a technique known in Japanese typography as tate-chu-yoko.

It only matters in vertical writing modes; in horizontal text it has no effect.

CSS
.date {
  text-combine-upright: all;
}

Try it

Combining digits in vertical text

Syntax

CSS
text-combine-upright: none | all | digits <integer>?;
  • Initial value: none
  • Applies to: inline boxes and text (non-replaced)
  • Inherited: yes
  • Animatable: no (discrete)
  • Computed value: as specified

Values

Value Description
none No combining. Characters follow the normal vertical flow.
all All the characters of the element are combined into one cell. Put it on a span around a short run.
digits Runs of digits are combined automatically. An optional integer from 2 to 4 sets the longest run to combine; the default is 2.

Usage notes

  • Keep runs short. Combining works well for two to four characters. A long run is shrunk until it becomes unreadable.
  • Use a wrapper. With all, wrap only the characters to combine, such as <span class="combine">12</span>.
  • The text stays text. Copy, search and screen readers still see the original characters.
  • Related behavior. Without combining, text-orientation decides whether other characters are rotated or upright.
  • Fonts matter. The final glyph size depends on the font, which can differ across systems.
  • Common uses: dates, house numbers, short abbreviations and units in Japanese or Chinese vertical text.

Browser support

all is supported in current major browsers; digits has had less consistent support, so check a compatibility table before using it.