模板:Writing-mode
This template is a shortcut for adding writing mode property using CSS. It generates the CSS for various browsers. Supported browsers are the current versions of Firefox, Safari, Chrome and Edge.
Usage
Insert this template within a style tag of any block-style element:
{{writing-mode | [directionality]}}
The following value making the text vertically, but the direction of columns is different:
- v, v1, tbrl: apply right-to-left direction to colums
- v2, tblr: apply left-to-right direction to colums
The h value making the text horizontally, maybe it also produce "Tate-chū-yoko" effect within vertical text:
The following value making the text just rotate to 90° in different direction:
- s1: clockwise
- s2: counter-clockwise
Example
<div style="{{writing-mode|v1}}">Lorem ipsum...</div>will produce:
<div style="{{writing-mode|v2}}">Lorem ipsum...</div>will produce:
See also
{{#switch:
|v|v1|tbrl|vertical-rl=-webkit-writing-mode: vertical-rl; -o-writing-mode: vertical-rl; -ms-writing-mode: tb-rl;writing-mode: tb-rl; writing-mode: vertical-rl; layout-flow: vertical-ideographic; |v2|tblr|vertical-lr=-webkit-writing-mode: vertical-lr; -o-writing-mode: vertical-lr; -ms-writing-mode: tb-lr; writing-mode: tb-lr; writing-mode: vertical-lr; |h|lrtb|horizontal-tb=-webkit-writing-mode: horizontal-tb; -o-writing-mode: horizontal-tb; -ms-writing-mode: lr-tb; writing-mode: lr-tb;writing-mode: horizontal-tb;layout-flow: horizontal; |s1=-webkit-writing-mode: sideways-rl; writing-mode: sideways-rl; |s2=-webkit-writing-mode: sideways-lr; writing-mode: sideways-lr; }