寫入模型 | writing-mode (Writing Modes) – CSS 中文開發手冊
寫入模型 | writing-mode (Writing Modes) - CSS 中文開發手冊
writing-modeCSS屬性定義文字行是否水平或垂直佈置以及塊擴充套件的方向。
/* Keyword values */ writing-mode: horizontal-tb; writing-mode: vertical-rl; writing-mode: vertical-lr; /* Global values */ writing-mode: inherit; writing-mode: initial; writing-mode: unset;
語法
該屬性指定塊流向,即塊級別容器堆疊的方向,以及內聯級別內容在塊容器內流動的方向。因此,writing-mode屬性也決定了塊級內容的排序。
Initial value |
horizontal-tb |
---|---|
Applies to |
all elements except table row groups, table column groups, table rows, and table columns |
Inherited |
yes |
Media |
visual |
Computed value |
as specified |
Animation type |
discrete |
Canonical order |
the unique non-ambiguous order defined by the formal grammar |
可能值
horizontal-tb——內容按從左到右水平從上到下垂直流動。下一條水平線位於上一條線的下方。
vertical-rl——內容按從上到下垂直流動,水平從右到左。下一條垂直線位於前一行的左側。
vertical-lr——內容按從上到下垂直流動,水平從左到右。下一條垂直線位於上一行的右側。
sideways-rl——內容按從上到下垂直流動,所有的字形,甚至是垂直字形的字形都被設定在右側。sideways-lr——內容按從上到下垂直流動,所有的字形,甚至垂直的字形,都被放在左側。
lr——已棄用,但SVG1文件除外。對於CSS,使用horizontal-tb。
lr-tb——已棄用,但SVG1文件除外。對於CSS,使用horizontal-tb。
rl——已棄用,但SVG1文件除外。對於CSS,使用horizontal-tb。
tb——已棄用,但SVG1文件除外。對於CSS,使用vertical-lr。
tb-rl——已棄用,但SVG1文件除外。對於CSS,使用vertical-rl。
形式語法
horizontal-tb | vertical-rl | vertical-lr | sideways-rl | sideways-lr
例項
實際結果
規範
Specification |
Status |
Comment |
---|---|---|
CSS Writing Modes Module Level 3The definition of 'writing-mode' in that specification. |
Candidate Recommendation |
Initial definition |
UnknownThe definition of 'writing-mode' in that specification. |
Unknown |
Add sideways-lr and sideways-rl |
瀏覽器相容性
Feature |
Chrome |
Edge |
Firefox |
Internet Explorer (defunct) |
Opera |
Safari |
---|---|---|---|---|---|---|
Basic support |
8-webkit (Yes) |
(Yes)-webkit (Yes) |
41 (41)1 |
9-ms2 |
15-webkit |
5.1-webkit |
lr |
48 (uprefixed) |
(Yes) |
43 (43) |
9-ms2 |
(Yes) |
? |
Feature |
Android |
Android Webview |
Chrome for Android |
Edge |
Firefox Mobile (Gecko) |
IE Mobile |
Opera Mobile |
Safari Mobile |
|
---|---|---|---|---|---|---|---|---|---|
Basic support |
3-webkit |
(Yes) |
47-webkit (Yes) |
(Yes)-webkit (Yes) |
41.0 (41) 1 |
? |
? |
5.1 -webkit |
|
SVG 1.1 values lr, lr-tb, rl, tb, tb-rl |
? |
48.0 (uprefixed) |
48.0 (uprefixed) |
(Yes) |
43.0 (43) |
? |
? |
? |
|
sideways-rl,sideways-lr |
No support4 |
No support |
No support |
No support |
? |
? |
? |
? |
|
vertical-lr |
vertical-rl |
No support4 |
No support |
No support |
No support |
? |
? |
? |
? |
另見
SVG writing-mode attributedirectionunicode-biditext-orientationtext-combine-upright
CSS 中文開發手冊 ]