π What is text-orientation?
The text-orientation property defines how individual characters are displayed in a vertical writing mode. It determines whether characters stay upright, rotate, or follow natural script rules when used along with writing-mode: vertical-rl | vertical-lr.
Note
β Essential for Japanese, Chinese, and Korean vertical layouts
β Important for UI labels, vertical sidebars, and posters
π― Why Use text-orientation?
- Keep Latin characters upright in vertical writing
- Rotate or not rotate punctuation and numbers
- Create Japanese-style vertical editorial layouts
- Improve readability in vertical navigation menus
π Syntax
text-orientation Syntax
text-orientation: mixed | upright | sideways | sideways-right;Works only when writing-mode is vertical.
π Values Explained
| Value | Description |
|---|---|
| mixed (default) | Upright CJK characters; Latin letters rotate 90Β° |
| upright | Every character stays upright (best for UI labels) |
| sideways | Characters rotate sideways as horizontal text |
| sideways-right | Legacy value β same as sideways in most browsers |
Note
π§ͺ Example 1 β Default (mixed)
mixed example
.vertical {
writing-mode: vertical-rl;
text-orientation: mixed;
}Latin characters rotate; CJK characters remain upright.
π§ͺ Example 2 β Keep All Characters Upright
upright example
.upright {
writing-mode: vertical-rl;
text-orientation: upright;
}Perfect for vertical navigation menus or branding.
π§ͺ Example 3 β Sideways Text
sideways example
.sideways {
writing-mode: vertical-rl;
text-orientation: sideways;
}Characters rotate as a group, preserving horizontal readability.
π¨ Example β Vertical Sidebar Navigation
Vertical Nav
.sidebar {
writing-mode: vertical-rl;
text-orientation: upright;
font-size: 1.2rem;
padding: 20px;
background: #222;
color: #fff;
height: 100vh;
}Keeps menu items readable without rotation.
π§© Behavior with CJK (Chinese/Japanese/Korean)
For CJK characters:
- mixed β keeps CJK upright (industry standard)
- upright β same behavior
- sideways β rotates characters
Note
π± Example β Vertical Book Title
Book Spine Layout
.book-title {
writing-mode: vertical-rl;
text-orientation: upright;
font-family: 'Georgia';
font-size: 1.8rem;
}Great for vertical book spines or editorial titles.
π§ Interaction with writing-mode
writing-mode changes text flow, text-orientation changes character rotation.
Combined Example
.label {
writing-mode: vertical-lr;
text-orientation: upright;
}| Property | Controls |
|---|---|
| writing-mode | Flow direction |
| text-orientation | Character orientation |
β οΈ Common Mistakes
- β Expecting text-orientation to work without vertical writing-mode
- β Using sideways when upright is needed for readability
- β Applying to background text (only works on actual text)
- β Forgetting that punctuation may rotate differently depending on script
Note
π₯ Summary
text-orientation lets you control how characters display in vertical writing modes β essential for international typography and creative UI designs. Whether youβre designing vertical navigation, artistic layouts, or supporting CJK languages, text-orientation gives you powerful control over readability and style.
Learn more βMDN Docs π