text-orientation 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 September 2020.

The text-orientation CSS property sets the orientation of the text characters in a line. It only affects text in vertical mode (when writing-mode is not horizontal-tb). It is useful for controlling the display of languages that use vertical script, and also for making vertical table headers.

Try it

writing-mode: vertical-rl;
text-orientation: mixed;
writing-mode: vertical-rl;
text-orientation: upright;
<section class="default-example" id="default-example">
  <div class="transition-all" id="example-element">
    <p>
      In another moment down went Alice after it, never once considering how in
      the world she was to get out again.
    </p>
  </div>
</section>

Syntax

css
/* Keyword values */
text-orientation: mixed;
text-orientation: upright;
text-orientation: sideways-right;
text-orientation: sideways;
text-orientation: use-glyph-orientation;

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

The text-orientation property is specified as a single keyword from the list below.

Values

mixed

Rotates the characters of horizontal scripts 90° clockwise. Lays out the characters of vertical scripts naturally. Default value.

upright

Lays out the characters of horizontal scripts naturally (upright), as well as the glyphs for vertical scripts. Note that this keyword causes all characters to be considered as left-to-right: the used value of direction is forced to be ltr.

sideways

Causes characters to be laid out as they would be horizontally, but with the whole line rotated 90° clockwise.

sideways-right

An alias to sideways that is kept for compatibility purposes.

use-glyph-orientation

On SVG elements, this keyword leads to use the value of the deprecated SVG properties glyph-orientation-vertical and glyph-orientation-horizontal.

Formal definition

Initial valuemixed
Applies toall elements, except table row groups, rows, column groups, and columns
Inheritedyes
Computed valueas specified
Animation typeNot animatable

Formal syntax

text-orientation = 
mixed |
upright |
sideways

Examples

HTML

html
<p>Lorem ipsum dolet semper quisquam.</p>

CSS

css
p {
  writing-mode: vertical-rl;
  text-orientation: upright;
}

Result

Specifications

Specification
CSS Writing Modes Level 4
# text-orientation

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-orientation
Chrome – Full support
Chrome 12 (Release date: 2011-06-07)
prefix
prefix Implemented with the vendor prefix: -webkit-
Chrome – Full support
Chrome 48 (Release date: 2016-01-20)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
prefix
prefix Implemented with the vendor prefix: -webkit-
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 41 (Release date: 2015-09-22)
footnote Full support
Opera – Full support
Opera 15 (Release date: 2013-07-02)
prefix
prefix Implemented with the vendor prefix: -webkit-
Opera – Full support
Opera 35 (Release date: 2016-02-02)
footnote Full support
Safari – Full support
Safari 5.1 (Release date: 2011-07-20)
prefix
prefix Implemented with the vendor prefix: -webkit-
Safari – Full support
Safari 14 (Release date: 2020-09-16)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
prefix
prefix Implemented with the vendor prefix: -webkit-
Chrome Android – Full support
Chrome Android 48 (Release date: 2016-01-26)
footnote Full support
Firefox for Android – Full support
Firefox for Android 41 (Release date: 2015-09-22)
footnote Full support
Opera Android – Full support
Opera Android 14 (Release date: 2013-05-21)
prefix
prefix Implemented with the vendor prefix: -webkit-
Opera Android – Full support
Opera Android 35 (Release date: 2016-02-04)
footnote Full support
Safari on iOS – Full support
Safari on iOS 5 (Release date: 2011-10-12)
prefix
prefix Implemented with the vendor prefix: -webkit-
Safari on iOS – Full support
Safari on iOS 14 (Release date: 2020-09-16)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
prefix
prefix Implemented with the vendor prefix: -webkit-
Samsung Internet – Full support
Samsung Internet 5 (Release date: 2016-12-15)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
prefix
prefix Implemented with the vendor prefix: -webkit-
WebView Android – Full support
WebView Android 48 (Release date: 2016-01-26)
footnote Full support
WebView on iOS – Full support
WebView on iOS 5 (Release date: 2011-10-12)
prefix
prefix Implemented with the vendor prefix: -webkit-
WebView on iOS – Full support
WebView on iOS 14 (Release date: 2020-09-16)
footnote Full support
mixed
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 41 (Release date: 2015-09-22)
footnote Full support
Opera – Full support
Opera 35 (Release date: 2016-02-02)
footnote Full support
Safari – Full support
Safari 13.1 (Release date: 2020-03-24)
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 41 (Release date: 2015-09-22)
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 13.4 (Release date: 2020-03-24)
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 13.4 (Release date: 2020-03-24)
footnote Full support
sideways
Chrome – Full support
Chrome 83 (Release date: 2020-05-19)
altname
altname Alternate name: sideways-right
Chrome – Full support
Chrome 12 (Release date: 2011-06-07)
footnote Full support
Edge – Full support
Edge 83 (Release date: 2020-05-21)
altname
altname Alternate name: sideways-right
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 72 (Release date: 2020-01-07)
altname
altname Alternate name: sideways-right
Firefox – Full support
Firefox 44 (Release date: 2016-01-26)
footnote Full support
Opera – Full support
Opera 69 (Release date: 2020-06-24)
altname
altname Alternate name: sideways-right
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – Full support
Safari 7 (Release date: 2013-10-22)
footnote Full support
Chrome Android – Full support
Chrome Android 83 (Release date: 2020-05-19)
altname
altname Alternate name: sideways-right
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 79 (Release date: 2020-07-28)
altname
altname Alternate name: sideways-right
Firefox for Android – Full support
Firefox for Android 44 (Release date: 2016-01-26)
footnote Full support
Opera Android – Full support
Opera Android 59 (Release date: 2020-06-30)
altname
altname Alternate name: sideways-right
Opera Android – Full support
Opera Android 14 (Release date: 2013-05-21)
footnote Full support
Safari on iOS – Full support
Safari on iOS 7 (Release date: 2013-09-18)
footnote Full support
Samsung Internet – Full support
Samsung Internet 13 (Release date: 2020-12-02)
altname
altname Alternate name: sideways-right
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
footnote Full support
WebView Android – Full support
WebView Android 83 (Release date: 2020-05-19)
altname
altname Alternate name: sideways-right
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – Full support
WebView on iOS 7 (Release date: 2013-09-18)
footnote Full support
upright
Chrome – Full support
Chrome 12 (Release date: 2011-06-07)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 41 (Release date: 2015-09-22)
footnote Full support
Opera – Full support
Opera 15 (Release date: 2013-07-02)
footnote Full support
Safari – Full support
Safari 13.1 (Release date: 2020-03-24)
footnote Full support
Chrome Android – Full support
Chrome Android 18 (Release date: 2012-06-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 41 (Release date: 2015-09-22)
footnote Full support
Opera Android – Full support
Opera Android 14 (Release date: 2013-05-21)
footnote Full support
Safari on iOS – Full support
Safari on iOS 13.4 (Release date: 2020-03-24)
footnote Full support
Samsung Internet – Full support
Samsung Internet 1 (Release date: 2013-04-27)
footnote Full support
WebView Android – Full support
WebView Android 4.4 (Release date: 2013-12-09)
footnote Full support
WebView on iOS – Full support
WebView on iOS 13.4 (Release date: 2020-03-24)
footnote Full support

Legend

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

Full support
Full support
Uses a non-standard name
Requires a vendor prefix or different name for use.
Has more compatibility info.

See also