text-combine-upright CSS property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2022.

The text-combine-upright CSS property sets the combination of characters into the space of a single character. If the combined text is wider than 1em, the user agent must fit the contents within 1em. The resulting composition is treated as a single upright glyph for layout and decoration. This property only has an effect in vertical writing modes.

This is used to produce an effect that is known as tate-chū-yoko 縦中横 in Japanese, or as 橫向文字 in Chinese.

Try it

text-combine-upright: none;
text-combine-upright: all;
<section class="default-example" id="default-example">
  <div>
    <p>
      <span class="transition-all" id="example-element">2022<span>年</span>12<span>月</span>8</span>日から楽しい
    </p>
  </div>
</section>
p {
  writing-mode: vertical-rl;
}

Syntax

css
/* Keyword values */
text-combine-upright: none;
text-combine-upright: all;

/* Global values */
text-combine-upright: inherit;
text-combine-upright: initial;
text-combine-upright: revert;
text-combine-upright: revert-layer;
text-combine-upright: unset;

Values

none

There is no special processing.

all

Attempts to typeset all consecutive characters within the box horizontally, such that they take up the space of a single character within the vertical line of the box.

Note: The CSS writing modes module defines a digits <integer> value for the text-combine-upright property to display two to four consecutive ASCII digits (U+0030–U+0039) such that it takes up the space of a single character within the vertical line box, however, this is not supported in any browsers.

Formal definition

Initial valuenone
Applies tonon-replaced inline elements
Inheritedyes
Computed valuespecified keyword, plus integer if 'digits'
Animation typeNot animatable

Formal syntax

text-combine-upright = 
none |
all |
[ digits <integer [2,4]>? ]

<integer> =
<number-token>

Examples

Using 'all' with horizontal text

The all value requires markup around every piece of horizontal text, but it is currently supported by more browsers than the digits value.

HTML

html
<p lang="zh-Hant">
  民國<span class="num">105</span>年<span class="num">4</span>月<span
    class="num"
    >29</span
  >日
</p>

CSS

css
html {
  writing-mode: vertical-rl;
  font: 24px serif;
}
.num {
  text-combine-upright: all;
}

Results

Specifications

Specification
CSS Writing Modes Level 4
# text-combine-upright

Browser compatibility

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-combine-upright
Chrome – Partial support
Chrome 9 (Release date: 2011-02-03)
altname
footnote Partial support
altname Alternate name: -webkit-text-combine
footnote This property was initially named -webkit-text-combine according to a 2011 version of the CSS3 Writing Modes specification, supporting the values none and horizontal without digits.
Chrome – Full support
Chrome 48 (Release date: 2016-01-20)
footnote Full support
Edge – No support
Edge 12 – 18 (Release date: 2015-07-29)
altname
altname Alternate name: -ms-text-combine-horizontal
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 48 (Release date: 2016-08-02)
footnote
footnote Before version 81, Firefox implemented the property as animatable. This was corrected to spec in 81.
Opera – Partial support
Opera 15 (Release date: 2013-07-02)
altname
footnote Partial support
altname Alternate name: -webkit-text-combine
footnote This property was initially named -webkit-text-combine according to a 2011 version of the CSS3 Writing Modes specification, supporting the values none and horizontal without digits.
Opera – Full support
Opera 35 (Release date: 2016-02-02)
footnote Full support
Safari – Partial support
Safari 5.1 (Release date: 2011-07-20)
altname
footnote Partial support
altname Alternate name: -webkit-text-combine
footnote This property was initially named -webkit-text-combine according to a 2011 version of the CSS3 Writing Modes specification, supporting the values none and horizontal without digits.
Safari – Full support
Safari 15.4 (Release date: 2022-03-14)
footnote Full support
Chrome Android – Partial support
Chrome Android 18 (Release date: 2012-06-27)
altname
footnote Partial support
altname Alternate name: -webkit-text-combine
footnote This property was initially named -webkit-text-combine according to a 2011 version of the CSS3 Writing Modes specification, supporting the values none and horizontal without digits.
Chrome Android – Full support
Chrome Android 48 (Release date: 2016-01-26)
footnote Full support
Firefox for Android – Full support
Firefox for Android 48 (Release date: 2016-08-02)
footnote
footnote Before version 81, Firefox for Android implemented the property as animatable. This was corrected to spec in 81.
Opera Android – Partial support
Opera Android 14 (Release date: 2013-05-21)
altname
footnote Partial support
altname Alternate name: -webkit-text-combine
footnote This property was initially named -webkit-text-combine according to a 2011 version of the CSS3 Writing Modes specification, supporting the values none and horizontal without digits.
Opera Android – Full support
Opera Android 35 (Release date: 2016-02-04)
footnote Full support
Safari on iOS – Partial support
Safari on iOS 5 (Release date: 2011-10-12)
altname
footnote Partial support
altname Alternate name: -webkit-text-combine
footnote This property was initially named -webkit-text-combine according to a 2011 version of the CSS3 Writing Modes specification, supporting the values none and horizontal without digits.
Safari on iOS – Full support
Safari on iOS 15.4 (Release date: 2022-03-14)
footnote Full support
Samsung Internet – Partial support
Samsung Internet 1 (Release date: 2013-04-27)
altname
footnote Partial support
altname Alternate name: -webkit-text-combine
footnote This property was initially named -webkit-text-combine according to a 2011 version of the CSS3 Writing Modes specification, supporting the values none and horizontal without digits.
Samsung Internet – Full support
Samsung Internet 5 (Release date: 2016-12-15)
footnote Full support
WebView Android – Partial support
WebView Android 4.4 (Release date: 2013-12-09)
altname
footnote Partial support
altname Alternate name: -webkit-text-combine
footnote This property was initially named -webkit-text-combine according to a 2011 version of the CSS3 Writing Modes specification, supporting the values none and horizontal without digits.
WebView Android – Full support
WebView Android 48 (Release date: 2016-01-26)
footnote Full support
WebView on iOS – Partial support
WebView on iOS 5 (Release date: 2011-10-12)
altname
footnote Partial support
altname Alternate name: -webkit-text-combine
footnote This property was initially named -webkit-text-combine according to a 2011 version of the CSS3 Writing Modes specification, supporting the values none and horizontal without digits.
WebView on iOS – Full support
WebView on iOS 15.4 (Release date: 2022-03-14)
footnote Full support
all
Chrome – Full support
Chrome 48 (Release date: 2016-01-20)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 48 (Release date: 2016-08-02)
footnote Full support
Opera – Full support
Opera 35 (Release date: 2016-02-02)
footnote Full support
Safari – Full support
Safari 15.4 (Release date: 2022-03-14)
footnote Full support
Chrome Android – Full support
Chrome Android 48 (Release date: 2016-01-26)
footnote Full support
Firefox for Android – Full support
Firefox for Android 48 (Release date: 2016-08-02)
footnote Full support
Opera Android – Full support
Opera Android 35 (Release date: 2016-02-04)
footnote Full support
Safari on iOS – Full support
Safari on iOS 15.4 (Release date: 2022-03-14)
footnote Full support
Samsung Internet – Full support
Samsung Internet 5 (Release date: 2016-12-15)
footnote Full support
WebView Android – Full support
WebView Android 48 (Release date: 2016-01-26)
footnote Full support
WebView on iOS – Full support
WebView on iOS 15.4 (Release date: 2022-03-14)
footnote Full support
none
Chrome – Full support
Chrome 48 (Release date: 2016-01-20)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 48 (Release date: 2016-08-02)
footnote Full support
Opera – Full support
Opera 35 (Release date: 2016-02-02)
footnote Full support
Safari – Full support
Safari 15.4 (Release date: 2022-03-14)
footnote Full support
Chrome Android – Full support
Chrome Android 48 (Release date: 2016-01-26)
footnote Full support
Firefox for Android – Full support
Firefox for Android 48 (Release date: 2016-08-02)
footnote Full support
Opera Android – Full support
Opera Android 35 (Release date: 2016-02-04)
footnote Full support
Safari on iOS – Full support
Safari on iOS 15.4 (Release date: 2022-03-14)
footnote Full support
Samsung Internet – Full support
Samsung Internet 5 (Release date: 2016-12-15)
footnote Full support
WebView Android – Full support
WebView Android 48 (Release date: 2016-01-26)
footnote Full support
WebView on iOS – Full support
WebView on iOS 15.4 (Release date: 2022-03-14)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
See implementation notes.
Uses a non-standard name
Has more compatibility info.

See also