Writing-mode property

Last updated: 2026-09-13

writing-mode Writing-mode property

The writing-mode CSS property sets the overall layout direction of the text, supporting horizontal (horizontal-tb) and vertical (vertical-rl, vertical-lr) modes. It is used to create vertical text like traditional Chinese or Japanese books and also changes how block and inline elements arrange themselves, making it an important tool for East Asian typography.

Category
Initial Valuehorizontal-tb
InheritedYes
Applies To
Animation Type
CSS VersionCSS3
StatusStandard

📝 Syntax

writing-mode: horizontal-tb | vertical-rl | vertical-lr;

⚙️ Values

ValueTypeDescription
horizontal-tb | vertical-rl | vertical-lrKeywordWriting direction values

▶ Example

Edit the code below and see the live result in the playground:

🌐 Browser Support

Browser ChromeChrome EdgeEdge FirefoxFirefox SafariSafari OperaOpera
writing-mode v43 v12 v16 v9 v30
Supported in all major browsers
Tip: vertical-rl is the traditional layout of Chinese books (top to bottom, right to left); vertical-lr is used for some Mongolian and Japanese layouts.
Important: writing-mode changes the direction mapping of CSS logical properties: for example, width maps to block-size and height to inline-size in vertical layout.

❓ FAQ

QWhat is the difference between writing-mode and direction in CSS?
Adirection only changes the text flow (left or right) while elements stay horizontal; writing-mode changes the whole layout direction, making block elements stack vertically and inline content display vertically too.
QDo the characters rotate in a vertical writing mode like vertical-rl?
AIn vertical-rl and vertical-lr the characters stay upright, just arranged from top to bottom. If you need the glyphs rotated 90 degrees, additionally use text-orientation: sideways.
QHow do I create vertical Chinese text using the writing-mode property?
ASet writing-mode: vertical-rl and the text flows top to bottom, right to left, mimicking traditional Chinese book layout; vertical-lr produces vertical text flowing left to right. By default the characters remain upright and unrotated.

📚 Related Tutorials

Web-Tutorial.com

Web-Tutorial Tech Team

A team of developers maintaining programming tutorials. Each tutorial is written and reviewed by developers with expertise in that field. We work to keep our content accurate and reliable — if you spot an issue, please let us know.

100%

🙏 帮我们做得更好

我们是刚上线的编程教程站,几个人的小团队,精力有限。页面虽经检查,难免还有疏漏——链接失效、排版错乱、内容有误、语言生硬……

如果您发现了,麻烦告诉我们,我们会在收到反馈后第一时间进行修复,再次感谢您的光临 🙏