CSS writing-mode Property
Description
The writing-mode CSS property controls the fundamental orientation and flow of inline content and block progression within an element. Instead of simply rotating characters, it redefines the element’s inline axis and block axis - that is, it determines which direction text runs along a line and which direction successive lines are stacked. Because of that axis redefinition, measurements and layout that use logical dimensions are affected: for example, block-size and inline-size map to different physical dimensions depending on the current writing mode, and logical margin/padding/offsets follow those same axes.
This property also interacts closely with typographic controls and bidirectional behavior. The way individual glyphs are oriented and whether vertical forms or rotated punctuation are used is influenced by text-orientation, while overall text directionality and embedding behavior remain governed by direction and unicode-bidi. It’s important to note the difference between changing the writing axis and visually rotating content: using transform to rotate an element does not change the underlying inline/block axes and therefore does not change how logical properties behave; writing-mode changes layout semantics rather than applying a simple visual rotation.
In practical terms, choosing a non-default writing mode affects line breaking, baseline alignment, and how UI components should be positioned and sized; controls and compositions that assume horizontal inline flow may need adaptation. It also matters for internationalization and accessibility: while writing-mode changes visual layout, it does not change DOM order or semantics - assistive technologies still read content in DOM order, so ensure source order matches the intended reading order when that matters. Finally, typographic support (fonts that supply vertical glyph variants, punctuation handling) and careful testing across combinations of writing mode and other layout features are essential to get predictable, legible results.
Definition
- Initial value
- horizontal-tb
- Applies to
- All elements except table row groups, table column groups, table rows, and table columns
- Inherited
- Yes
- Computed value
- Specified value
- Animatable
- No
- JavaScript syntax
- object.style.writingMode
Interactive Demo
Syntax
writing-mode: horizontal-tb | vertical-rl | vertical-lr
Values
- horizontal-tbTop-to-bottom block flow direction. The writing mode is horizontal.
- vertical-rlRight-to-left block flow direction. The writing mode is vertical.
- vertical-lrLeft-to-right block flow direction. The writing mode is vertical.
Example
Browser Support
The following information will show you the current browser support for the CSS writing-mode property. Hover over a browser icon to see the version that first introduced support for this CSS property.
This property is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 1st January 2026
