CSS writing-mode Property


Example

Specify whether lines of text are laid out horizontally or vertically:

p.test1 {
  writing-mode: horizontal-tb;
}

p.test2 {
  writing-mode: vertical-rl;
}

span.test2 {
  writing-mode: vertical-rl;
}
Try it Yourself »

Definition and Usage

The writing-mode property specifies whether lines of text are laid out horizontally or vertically.

Show demo ❯

Default value: horizontal-tb
Inherited: yes
Animatable: no. Read about animatable
Version: CSS3
JavaScript syntax: object.style.writingMode="vertical-rl"

Browser Support

The numbers in the table specify the first browser version that fully supports the property.

Property
writing-mode 48.0 12.0 41.0 11.0 35.0

CSS Syntax

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

Property Values

Value Description Demo
horizontal-tb Let the content flow horizontally from left to right, vertically from top to bottom Demo ❯
vertical-rl Let the content flow vertically from top to bottom, horizontally from right to left Demo ❯
vertical-lr Let the content flow vertically from top to bottom, horizontally from left to right Demo ❯

Related Pages

CSS tutorial: CSS Text Effects


Copyright 1999-2023 by Refsnes Data. All Rights Reserved.