CSS writing-mode Property
Example
.example1 {
writing-mode: horizontal-tb;
}
.example2 {
writing-mode: vertical-rl;
}
.example3 {
writing-mode: vertical-lr;
}
1
2
3
4
Meaning
The writing-mode 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.
Default value: | horizontal-tb |
Inherited: | Yes |
Animatable: | No |
Version: | CSS3 |
JavaScript syntax: |
|
Standard Syntax
writing-mode: horizontal-tb|vertical-rl|vertical-lr|initial|inherite|revert|revert-layer|unset;
Browser Support
The numbers in the table specify the first browser version that fully supports the property.
Status
Property Values
The following table describes the values of this property.
Value | Description |
---|---|
horizontal-tb | The content flow horizontally from left to right, vertically from top to bottom |
vertical-rl | The content flow vertically from top to bottom, horizontally from right to left |
vertical-lr | The content flow vertically from top to bottom, horizontally from left to right |
sideways-rl | For 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 right. |
sideways-lr | For 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 left. |
initial | Sets this property to its default value. |
inherit | If specified, the associated element takes the computed value of its parent element animation-delay property. |
revert | Reverts the cascaded value of the property from its current value to the value the property |
revert-layer | Rollback styles to the ones specified in previous cascade layers. |
unset | Resets a property to its inherited value if the property naturally inherits from its parent, and to its initial value if not. |
Default CSS Property Values
selectors {
writing-mode: horizontal-tb;
}