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.
Fundamentals
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.
Foundation
📝 Syntax
The syntax for the text-orientation property is straightforward. It can be applied to any element that supports vertical writing modes:
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
Defaults
🎯 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.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Default value
mixed
All characters upright
text-orientation: upright;
All characters rotated
text-orientation: sideways;
Pair with
writing-mode: vertical-rl;
Common use
Japanese, Chinese, and Korean vertical layouts
Inherited
Yes
Reference
💎 Property Values
The text-orientation property accepts keyword values that control character rotation in vertical lines.
Value
Example
Description
mixed
text-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.
upright
text-orientation: upright;
All characters are displayed upright.
sideways
text-orientation: sideways;
All characters are displayed sideways, rotated 90 degrees.
sideways-right
text-orientation: sideways-right;
All characters are displayed sideways, rotated 90 degrees to the right.
use-glyph-orientation
text-orientation: use-glyph-orientation;
Uses the glyph’s orientation defined by the font.
mixeduprightsidewayssideways-right
Context
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.
Preview
👀 Live Preview
All samples use writing-mode: vertical-rl; with different text-orientation values:
mixed
縦書き ABC
upright
縦書き ABC
sideways
Vertical ABC
Hands-On
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.
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.
Compatibility
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 Chrome48+ · Desktop & Mobile
Full support
Mozilla Firefox42+ · Desktop & Mobile
Full support
Apple Safari10.1+ · macOS & iOS
Full support
Microsoft Edge79+ · Chromium
Full support
Opera35+ · Modern versions
Full support
Testing tip
Compare upright and mixed values in Safari and Firefox with mixed Japanese and English text.
text-orientation property94% supported
Bottom line:text-orientation is safe to use for vertical CJK layouts and design labels in modern projects.
Wrap Up
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.