Skip to content
Tutorials Center
My learning

Topics

CSS Reference ยท Typography

The text-orientation property

Reference for the CSS text-orientation property: set how characters are rotated in vertical writing modes with mixed, upright and sideways, with live examples.

The text-orientation property decides how characters are turned when text runs vertically. In a vertical writing mode, Latin letters can lie on their side (rotated), stand upright one above another, or follow the script's natural rule.

It only has an effect in vertical writing modes, such as writing-mode: vertical-rl. In ordinary horizontal text it does nothing.

CSS
.spine {
  writing-mode: vertical-rl;
  text-orientation: upright;
}

Try it

Mixed, upright and sideways

In the first and third columns the Latin text is rotated 90 degrees clockwise. In the middle column each letter stands upright and the text reads from top to bottom, one character after another.

Syntax

CSS
text-orientation: mixed | upright | sideways
  • Initial value: mixed
  • Applies to: all elements except table row groups, rows, column groups and columns
  • Inherited: yes
  • Animatable: no
  • Computed value: as specified

Values

Value Description
mixed Characters from scripts that are normally written vertically (such as Chinese or Japanese) stay upright; characters from horizontal scripts such as Latin are rotated sideways.
upright All characters are set upright, including Latin letters. Text is also treated as left-to-right.
sideways All characters are rotated sideways, as if the horizontal line had been turned 90 degrees.

Usage notes

  • Pair it with writing-mode. Set a vertical mode first; text-orientation then refines it.
  • Short labels only. Upright Latin text is slow to read. It suits short labels such as tab names or decorative words, not paragraphs.
  • Rotated headings. For a rotated sidebar title in a Western site, writing-mode: vertical-rl with the default mixed is usually enough.
  • Different from transforms. rotate() turns the whole box and its layout space stays horizontal; vertical writing modes reflow the text and the box.
  • Reading direction. Remember that vertical-rl places new lines to the left, and vertical-lr places them to the right.
  • Legacy values. Older drafts had other keywords such as sideways-right; use the three listed here.

Browser support

Supported in current versions of the major browsers, but the sideways value arrived later than mixed and upright, so check a compatibility table if you need it.