CSS writing-mode property
Example
The table below shows the different writing modes:
.example
.Text1
span
,
.example
.Text1
{
writing-mode:
horizontal-tb
; -
webkit-writing-mode:
horizontal-tb
; -
ms-writing-mode:
horizontal-tb
;
}
.example
.Text2
span
,
.example
.Text2
{
writing-mode:
vertical-lr
; -
webkit-writing-mode:
vertical-lr
; -
ms-writing-mode:
vertical-lr
;
}
.example
.Text3
span
,
.example
.Text3
{
writing-mode:
vertical-rl
; -
webkit-writing-mode:
vertical-rl
; -
ms-writing-mode:
vertical-rl
;
}
.example
.Text4
span
,
.example
.Text4
{
writing-mode:
sideways-lr
; -
webkit-writing-mode:
sideways-lr
; -
ms-writing-mode:
sideways-lr
;
}
.example
.Text5
span
,
.example
.Text5
{
writing-mode:
sideways-rl
; -
webkit-writing-mode:
sideways-rl
; -
ms-writing-mode:
sideways-rl
;
}
Try it »
Property definition and usage
The writing-mode property defines how text is laid out in horizontal or vertical directions.
The syntax format is as follows:
writing-mode: horizontal-tb | vertical-rl | vertical-lr | sideways-rl | sideways-lr
- horizontal-tb: horizontal writing from top to bottom, i.e., left-right-top-bottom
- vertical-rl: vertical writing from right to left, i.e., top-bottom-right-left
- vertical-lr: content flows from top to bottom vertically and from left to right horizontally
- sideways-rl: content is arranged vertically from top to bottom
- sideways-lr: content is arranged vertically from bottom to top
Browser support
The numbers in the table indicate the first browser version that supports this property.
| property | |||||
|---|---|---|---|---|---|
| writing-mode | 8.0 | 6.0 | 41.0 | 5.1 | 15 |