CSS text-orientation Property

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 4 Examples
Typography

What You’ll Learn

The text-orientation property controls how characters rotate in vertical writing modes — using mixed, upright, or sideways values.

01

Vertical Text

Character rotation.

02

mixed

Default behavior.

03

upright

All upright.

04

sideways

Rotated 90°.

05

writing-mode

Pair vertical flow.

06

CJK Text

East Asian layouts.

Introduction

The text-orientation property in CSS is used to define the orientation of text within a line when dealing with vertical writing modes.

This property is particularly useful for languages like Chinese, Japanese, and Korean, which are often written vertically. It allows for finer control over the display of characters in a vertical context, ensuring they are presented in the most readable and aesthetically pleasing manner.

Definition and Usage

Use text-orientation together with writing-mode: vertical-rl; or writing-mode: vertical-lr; when you need to control whether characters stay upright or rotate sideways inside vertical lines.

💡
Beginner Tip

Start with writing-mode: vertical-rl; and text-orientation: upright; to display all characters upright in a vertical Japanese or Chinese text block.

📝 Syntax

The syntax for the text-orientation property is straightforward. It can be applied to any element that supports vertical writing modes:

syntax.css
element {
  text-orientation: value;
}

Basic Example

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

Syntax Rules

  • Pair text-orientation with a vertical writing-mode value.
  • Use mixed for the browser default character rotation behavior.
  • Use upright when every character should remain upright.
  • The property is inherited, so parent values can affect nested vertical text.

Related Properties

  • writing-mode — sets horizontal or vertical text flow
  • direction — sets inline text direction
  • text-combine-upright — combines digits or letters in vertical text

🎯 Default Value

The default value of the text-orientation property is mixed, which means the text will use an upright orientation for characters that are typically written upright and a sideways orientation for characters that are typically written sideways.

⚡ Quick Reference

QuestionAnswer
Default valuemixed
All characters uprighttext-orientation: upright;
All characters rotatedtext-orientation: sideways;
Pair withwriting-mode: vertical-rl;
Common useJapanese, Chinese, and Korean vertical layouts
InheritedYes

💎 Property Values

The text-orientation property accepts keyword values that control character rotation in vertical lines.

ValueExampleDescription
mixedtext-orientation: mixed;This is the default value. Text is displayed upright for characters that have an upright version and sideways for characters that do not.
uprighttext-orientation: upright;All characters are displayed upright.
sidewaystext-orientation: sideways;All characters are displayed sideways, rotated 90 degrees.
sideways-righttext-orientation: sideways-right;All characters are displayed sideways, rotated 90 degrees to the right.
use-glyph-orientationtext-orientation: use-glyph-orientation;Uses the glyph’s orientation defined by the font.
mixed upright sideways sideways-right

When to Use text-orientation

text-orientation helps when vertical text needs precise character presentation:

  • Japanese vertical novels — Use upright for traditional upright character display.
  • Mixed Latin and CJK text — Use mixed so Latin letters rotate naturally in vertical flow.
  • Design labels — Use sideways for rotated Latin text in vertical layouts.
  • Multilingual sites — Match orientation rules to each language section.

👀 Live Preview

All samples use writing-mode: vertical-rl; with different text-orientation values:

mixed

縦書き ABC

upright

縦書き ABC

sideways

Vertical ABC

Examples Gallery

In this example, we’ll apply the text-orientation property to a vertical text container, then explore more orientation patterns.

📜 Vertical Character Orientation

Control how characters appear inside vertical writing-mode layouts.

Example 1 — Upright vertical Japanese text

In this example, we’ll apply the text-orientation property to a vertical text container.

index.html
<style>
  .vertical-text {
    writing-mode: vertical-rl;
    text-orientation: upright;
    border: 1px solid #000;
    padding: 10px;
    width: 100px;
    height: 200px;
  }
</style>

<h1>Text Orientation Example</h1>
<div class="vertical-text">
  これは縦書きのテキストです。
</div>
Try It Yourself

How It Works

Vertical flow comes from writing-mode, while upright keeps every character standing upright in the line.

Example 2 — mixed for Latin and CJK together

Use the default mixed value when vertical text contains both CJK characters and Latin letters.

mixed-orientation.css
.mixed-vertical {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  height: 12rem;
}
Try It Yourself

How It Works

mixed lets the browser rotate Latin characters sideways while keeping CJK characters upright when possible.

📄 Design & Label Layouts

Use sideways orientation for rotated Latin labels in vertical designs.

Example 3 — sideways Latin text in vertical flow

Rotate all characters 90 degrees with sideways for horizontal-letter appearance in vertical columns.

sideways-orientation.css
.sideways-label {
  writing-mode: vertical-rl;
  text-orientation: sideways;
  height: 10rem;
  font-weight: 600;
}
Try It Yourself

How It Works

Every character rotates sideways, which is useful for Latin labels running vertically along a page edge.

Example 4 — Vertical side label with upright text

Combine vertical writing with upright orientation for a clean sidebar chapter label.

chapter-label.css
.chapter-label {
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: 0.15em;
  color: #9333ea;
}
Try It Yourself

How It Works

Upright orientation with extra letter spacing creates a readable vertical chapter marker.

♿ Accessibility

  • Test readability — Vertical text can be harder to read for some users; use it intentionally.
  • Provide alternatives — Offer horizontal reading modes when possible for long content.
  • Screen readers — Orientation is visual; content order should still make sense in the DOM.
  • Avoid tiny vertical labels — Small rotated text can fail contrast and readability checks.

text-orientation with writing-mode

text-orientation does not create vertical text by itself. Set writing-mode first, then choose how characters rotate inside each vertical line.

vertical-pair.css
.vertical-panel {
  writing-mode: vertical-rl;
  text-orientation: upright;
}

🧠 How text-orientation Works

1

Vertical writing mode is set

writing-mode: vertical-rl; makes lines stack vertically.

Flow
2

You choose character orientation

Pick mixed, upright, or sideways.

Orientation
3

Browser rotates glyphs per line

Each character is rendered upright or sideways according to your chosen value.

Rendering
=

Readable vertical typography

CJK and mixed-language vertical layouts look correct and intentional.

Browser Compatibility

The text-orientation property is supported in most modern browsers, including the latest versions of Chrome, Firefox, Safari, Edge, and Opera. However, it is always a good practice to test your website across different browsers to ensure compatibility.

Modern browsers · Wide support

Vertical orientation in today’s browsers

Chrome, Firefox, Safari, Edge, and Opera all support text-orientation in current versions.

94% Modern browser support
Google Chrome 48+ · Desktop & Mobile
Full support
Mozilla Firefox 42+ · Desktop & Mobile
Full support
Apple Safari 10.1+ · macOS & iOS
Full support
Microsoft Edge 79+ · Chromium
Full support
Opera 35+ · Modern versions
Full support

Testing tip

Compare upright and mixed values in Safari and Firefox with mixed Japanese and English text.

text-orientation property 94% supported

Bottom line: text-orientation is safe to use for vertical CJK layouts and design labels in modern projects.

Conclusion

The text-orientation property is a valuable tool for web developers working with vertical text layouts.

By customizing the orientation of text within a line, you can create more readable and visually appealing content, particularly for languages that use vertical writing. Experiment with different values to see how this property can enhance the presentation of your vertical text.

💡 Best Practices

✅ Do

  • Set writing-mode before applying text-orientation
  • Use upright for traditional vertical CJK content
  • Use mixed when Latin and CJK characters appear together
  • Test vertical layouts in Safari and mobile browsers
  • Keep vertical labels large enough to read comfortably

❌ Don’t

  • Expect orientation changes without vertical writing mode
  • Use vertical text for long body copy without a good reason
  • Rely on tiny sideways labels for critical navigation
  • Forget to test mixed-language vertical paragraphs

Key Takeaways

Knowledge Unlocked

Five things to remember about text-orientation

Use these points when styling vertical text.

5
Core concepts
02

mixed

Default value.

Default
03

upright

All upright.

CJK
04

sideways

Rotated 90°.

Labels
📝 05

writing-mode

Needs vertical.

Pair

❓ Frequently Asked Questions

text-orientation controls how characters are rotated within a line when using vertical writing modes such as vertical-rl or vertical-lr.
The default is mixed, which keeps upright characters upright and rotates others sideways as needed.
Yes. text-orientation mainly affects text when writing-mode is set to a vertical value like vertical-rl.
upright displays all characters upright. sideways rotates all characters 90 degrees for a horizontal-letter look in vertical flow.
Yes, text-orientation is inherited, so setting it on a parent can affect nested vertical text blocks.

Practice in the Live Editor

Open the HTML editor and try writing-mode: vertical-rl; with text-orientation: upright;.

HTML Editor →

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.

5 people found this page helpful