Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2017.
* Some parts of this feature may have varying levels of support.
The writing-mode CSS property sets whether lines of text are laid out horizontally or vertically, as well as the direction in which blocks progress. When set for an entire document, it should be set on the root element (html element for HTML documents).
This property specifies the block flow direction, which is the direction in which block-level containers are stacked, and the direction in which inline-level content flows within a block container. Thus, it also determines the ordering of block-level content.
The writing-mode property is specified as one of the values listed below. The flow direction in horizontal scripts is also affected by the directionality of that script, either left-to-right (ltr, like English and most other languages) or right-to-left (rtl, like Hebrew or Arabic).
For ltr scripts, content flows horizontally from left to right. For rtl scripts, content flows horizontally from right to left. The next horizontal line is positioned below the previous line.
vertical-rlFor ltr scripts, content flows vertically from top to bottom, and the next vertical line is positioned to the left of the previous line. For rtl scripts, content flows vertically from bottom to top, and the next vertical line is positioned to the left of the previous line.
vertical-lrFor ltr scripts, content flows vertically from top to bottom, and the next vertical line is positioned to the right of the previous line. For rtl scripts, content flows vertically from bottom to top, and the next vertical line is positioned to the right of the previous line.
sideways-rlFor ltr scripts, content flows vertically from top to bottom. For rtl scripts, content flows vertically from bottom to top. All the glyphs, even those in vertical scripts, are set sideways toward the right.
sideways-lrFor ltr scripts, content flows vertically from bottom to top. For rtl scripts, content flows vertically from top to bottom. All the glyphs, even those in vertical scripts, are set sideways toward the left.
lrDeprecated except for SVG1 documents. For CSS, use horizontal-tb instead.
lr-tbDeprecated except for SVG1 documents. For CSS, use horizontal-tb instead.
rlDeprecated except for SVG1 documents. For CSS, use horizontal-tb instead.
tbDeprecated except for SVG1 documents. For CSS, use vertical-lr instead.
tb-lrDeprecated except for SVG1 documents. For CSS, use vertical-lr instead.
tb-rlDeprecated except for SVG1 documents. For CSS, use vertical-rl instead.
| horizontal-tb |
| all elements except table row groups, table column groups, table rows, and table columns |
| yes |
| as specified |
| Not animatable |
This example demonstrates all of the writing modes, showing each with text in various languages.
The HTML is a <table> with each writing mode in a row with a column showing text in various scripts using that writing mode.
The CSS that adjusts the directionality of the content looks like this:
If your browser doesn't support sideways-lr, a workaround is to use transform to achieve a similar effect depending on the script direction. The effect of vertical-rl is the same as with sideways-lr, so no transformation is required for left-to-right scripts. In some cases, rotating the text 180 degrees is sufficient to achieve the effect of sideways-lr, but font glyphs may not be designed to be rotated, so this may produce unexpected positioning or rendering.
| CSS Writing Modes Level 4 # block-flow |
| Scalable Vector Graphics (SVG) 2 # WritingModeProperty |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Apr 20, 2026 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.