← Back to Home

CSS writing-mode

The writing-mode CSS property defines whether lines of text are laid out horizontally or vertically and the direction in which blocks progress. This is essential for supporting internationalization, creative layouts, and advanced typographic effects.

Syntax

writing-mode: horizontal-tb | vertical-rl | vertical-lr | sideways-rl | sideways-lr;
πŸ’‘ Tip: Combine writing-mode with text-orientation for even more control over vertical text appearance!

Interactive Examples

Horizontal (Default)

Horizontal-tb (default): English text flows left to right.
.horizontal-tb {
  writing-mode: horizontal-tb;
}

Vertical Right-to-Left

vertical-rl: ζ–‡ε­—γ―δΈŠγ‹γ‚‰δΈ‹γ€ε³γ‹γ‚‰ε·¦γΈζ΅γ‚ŒγΎγ™γ€‚
.vertical-rl {
  writing-mode: vertical-rl;
}

Vertical Left-to-Right

vertical-lr: ζ–‡ε­—γ―δΈŠγ‹γ‚‰δΈ‹γ€ε·¦γ‹γ‚‰ε³γΈζ΅γ‚ŒγΎγ™γ€‚
.vertical-lr {
  writing-mode: vertical-lr;
}

Sideways Right-to-Left

sideways-rl: Vertical text, rotated for creative effect.
.sideways-rl {
  writing-mode: sideways-rl;
}

Sideways Left-to-Right

sideways-lr: Vertical text, rotated the other way.
.sideways-lr {
  writing-mode: sideways-lr;
}
Try it out: Each card demonstrates a different writing-mode value. Resize your browser or copy the code to experiment in your own projects!

Live Playground

Experiment with writing-mode using the controls below.

Choose a Mode

Applied CSS:

writing-mode: horizontal-tb;

Example Content

This is a demonstration of how the writing-mode property affects text flow and block direction. Notice how 'width' and 'height' are interpreted differently in vertical modes.

References