CSS text-orientation Property

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The text-orientation property sets the orientation of characters in a line. It only affects text in vertical mode—when writing-mode is not horizontal-tb.

It is inherited. The initial value is mixed. Use it for vertical scripts and for vertical table headers or labels.

Note Vertical writing mode required

In horizontal-tb, changing text-orientation has no visible effect. Set writing-mode: vertical-rl (or similar) first.

Compatibility Legacy keywords

sideways-right is an alias of sideways. use-glyph-orientation is for older SVG glyph-orientation properties—prefer the standard keywords in new CSS.

CSS Syntax

syntax.css
text-orientation: mixed | upright | sideways | initial | inherit;

One keyword only. Pair it with a vertical writing-mode to see the result.

Property Values

ValueDescriptionTry it
mixedDefault. Horizontal scripts rotate 90°; vertical scripts stay naturalTry it
uprightAll characters upright; forces used direction to ltrTry it
sidewaysWhole line laid out horizontally, then rotated 90° clockwiseTry it
initialResets to mixedTry it
inheritTakes the parent’s orientationTry it

How to Use text-orientation

Turn on vertical writing first, then choose how each glyph should face.

  1. Set a vertical writing mode: writing-mode: vertical-rl.
  2. Choose mixed (default), upright, or sideways.
  3. Use upright for stacked Latin letters in vertical headers.
  4. Use sideways when the whole line should read like rotated horizontal text.
PieceRequired?Role
Vertical writing-modeYes (to see it)Makes orientation visible
Orientation keywordYesmixed, upright, or sideways
Text contentYesLatin vs CJK characters show different mixed behavior
directionContextupright forces used direction to ltr

Live Preview

The sample uses writing-mode: vertical-rl. Switch orientation to compare mixed, upright, and sideways.

Latin letters show the difference clearly. Try Japanese text in the examples too.

Orientation preview

ABC 縦書き

text-orientation: upright

CSS Examples

Each snippet focuses on text-orientation and includes a vertical writing-mode so the effect is visible. Use Try It Yourself for a live editor.

Example 1 — Default Mixed

Horizontal-script letters rotate; vertical-script letters stay natural.

CSS
<style>
  p {
    writing-mode: vertical-rl;
    text-orientation: mixed;
  }
</style>

<p>ABC 縦書き</p>
Try It Yourself

How It Works

  1. Go vertical. writing-mode: vertical-rl stacks the line.
  2. Use mixed. Latin letters rotate 90° clockwise.
  3. CJK stays natural. Vertical-script glyphs keep their usual orientation.
  4. Default behavior. Leaving the property unset looks the same.

Example 2 — Upright Characters

Stack Latin letters upright—common for vertical headers.

CSS
<style>
  p {
    writing-mode: vertical-rl;
    text-orientation: upright;
  }
</style>

<p>HEADER</p>
Try It Yourself

How It Works

  1. Keep vertical mode. Same as the first example.
  2. Set upright. Each Latin letter stands upright in the column.
  3. Direction forced. Characters are treated as left-to-right.
  4. Good for labels. Vertical table headers often use this look.

Example 3 — Sideways Line

Lay the line out as horizontal text, then rotate it 90° clockwise.

CSS
<style>
  p {
    writing-mode: vertical-rl;
    text-orientation: sideways;
  }
</style>

<p>Sideways line</p>
Try It Yourself

How It Works

  1. Stay in vertical mode. The writing mode still flows vertically.
  2. Set sideways. Glyphs follow horizontal layout rules first.
  3. Rotate the line. The whole line turns 90° clockwise.
  4. Different from upright. Letters do not stack face-up one by one.

Edge Cases & Pitfalls

If nothing seems to rotate, check these first.

mode

Ignored in horizontal writing

With writing-mode: horizontal-tb, orientation changes are not visible.

upright

upright forces LTR

The used value of direction becomes ltr for those characters.

mixed

Script type matters for mixed

Latin and other horizontal scripts rotate; vertical scripts stay natural. Mixed content shows both behaviors.

legacy

Prefer modern keywords

Use sideways instead of sideways-right. Avoid use-glyph-orientation outside legacy SVG work.

scope

Not for table rows or columns

It applies to most elements, but not table row groups, rows, column groups, or columns.

Browser Support

text-orientation is a browser writing-mode property. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available

text-orientation

Interoperable across modern browsers since about September 2020. Internet Explorer does not support this property.

97% Modern browsers
Google Chrome 48+
Full
Mozilla Firefox 41+
Full
Apple Safari 14+
Full
Microsoft Edge 79+
Full
Opera 35+
Full
Samsung Internet 5+
Full
Internet Explorer No
None
text-orientation Widely supported

Bottom line: Safe for modern sites. Older engines used a -webkit- prefix; IE has no support.

Key Takeaways

  • Role: set character orientation in vertical writing modes.
  • Values: mixed (default), upright, sideways.
  • Requires: vertical writing-mode. Inherited.
  • Tip: upright for stacked Latin headers; sideways for a rotated horizontal line.

One line: text-orientation decides whether vertical-mode glyphs stand upright, rotate, or follow a sideways line.

Frequently Asked Questions

It sets how characters orient in a line. It only affects text in vertical writing modes, such as writing-mode: vertical-rl.
The initial value is mixed. Horizontal-script characters rotate 90° clockwise; vertical-script characters stay natural.
Yes. In horizontal-tb, text-orientation has no visible effect. Use a vertical writing-mode to see it.
upright keeps characters standing upright in the vertical line. sideways lays characters out as in horizontal text, then rotates the whole line 90° clockwise.
Yes. upright forces the used value of direction to ltr for those characters.
It is Baseline Widely available (interoperable since about September 2020) in modern browsers. Internet Explorer does not support it. It is a browser layout property, not a Node.js feature.

Next: text-overflow

Learn how to clip overflowing text with an ellipsis.

text-overflow tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful