文字方向
div {
direction: ltr; /* Default, text read read from left-to-right */
}
.ex {
direction: rtl; /* text read from right-to-left */
}
.horizontal-tb {
writing-mode: horizontal-tb; /* Default, text read from left-to-right and top-to-bottom. */
}
.vertical-rtl {
writing-mode: vertical-rl; /* text read from right-to-left and top-to-bottom */
}
.vertical-ltr {
writing-mode: vertical-rl; /* text read from left-to-right and top to bottom */
}
direction
屬性用於更改元素的水平文字方向。
語法:direction: ltr | rtl | initial | inherit;
writing-mode
屬性更改文字的對齊方式,因此可以從上到下或從左到右讀取,具體取決於語言。
語法:direction: horizontal-tb | vertical-rl | vertical-lr;