diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/css/text-orientation/index.html | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/css/text-orientation/index.html')
-rw-r--r-- | files/zh-cn/web/css/text-orientation/index.html | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/files/zh-cn/web/css/text-orientation/index.html b/files/zh-cn/web/css/text-orientation/index.html new file mode 100644 index 0000000000..34decf78f3 --- /dev/null +++ b/files/zh-cn/web/css/text-orientation/index.html @@ -0,0 +1,108 @@ +--- +title: text-orientation +slug: Web/CSS/text-orientation +tags: + - CSS + - 书写方式 + - 书写模式 + - 文字方向 +translation_of: Web/CSS/text-orientation +--- +<div>{{CSSRef}}</div> + +<p><span class="seoSummary"><strong><code>text-orientation</code></strong> <a href="/en-US/docs/Web/CSS">CSS</a> 属性设定行中字符的方向。但它仅影响纵向模式(当 {{cssxref("writing-mode")}} 的值不是<code>horizontal-tb</code>)下的文本。此属性在控制使用竖排文字的语言的显示上很有作用,也可以用来构建垂直的表格头。</span></p> + +<div>{{EmbedInteractiveExample("pages/css/text-orientation.html")}}</div> + + + +<h2 id="语法">语法</h2> + +<pre class="brush:css no-line-numbers notranslate">/* Keyword values */ +text-orientation: mixed; +text-orientation: upright; +text-orientation: sideways-right; +text-orientation: sideways; +text-orientation: use-glyph-orientation; + +/* Global values */ +text-orientation: inherit; +text-orientation: initial; +text-orientation: unset; +</pre> + +<p><code>text-orientation</code> 应当被设置为上述关键字之一。</p> + +<h3 id="值">值</h3> + +<dl> + <dt><code>mixed</code></dt> + <dd>默认值。顺时针旋转水平书写的字符90°,将垂直书写的文字自然布局。</dd> + <dt><code>upright</code></dt> + <dd>将水平书写的字符自然布局(直排),包括垂直书写的文字(as well as the glyphs for vertical scripts)。注意这个关键字会导致所有字符被视为从左到右,也就是 {{cssxref("direction")}} 被强制设为 <code>ltr</code>。</dd> + <dt><code>sideways</code></dt> + <dd>所有字符被布局为与水平方式一样,但是整行文本被顺时针旋转90°。</dd> + <dt><code>sideways-right</code></dt> + <dd>处于兼容目的,<code>sideways</code> 的别名。</dd> + <dt><code>use-glyph-orientation</code></dt> + <dd>对于SVG元素,这个关键字导致使用已弃用的SVG属性。 <code>glyph-orientation-vertical</code> 和 <code>glyph-orientation-horizontal</code>。</dd> +</dl> + +<h2 id="形式化定义">形式化定义</h2> + +<p>{{CSSInfo}}</p> + +<h2 id="形式化语法">形式化语法</h2> + +<pre class="syntaxbox notranslate">{{csssyntax}}</pre> + +<h2 id="例子">例子</h2> + +<h3 id="HTML">HTML</h3> + +<pre class="brush: html notranslate"><p>Lorem ipsum dolet semper quisquam.</p></pre> + +<h3 id="CSS">CSS</h3> + +<pre class="brush: css notranslate">p { + writing-mode: vertical-rl; + text-orientation: upright; +}</pre> + +<h3 id="结果">结果</h3> + +<p>{{EmbedLiveSample('例子')}}</p> + +<h2 id="规范">规范</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">Specification</th> + <th scope="col">Status</th> + <th scope="col">Comment</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('CSS3 Writing Modes', '#text-orientation', 'text-orientation')}}</td> + <td>{{Spec2('CSS3 Writing Modes')}}</td> + <td>Initial definition.</td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + + + +<p>{{Compat("css.properties.text-orientation")}}</p> + +<h2 id="参见">参见</h2> + +<ul> + <li>The other vertical-script related CSS properties: {{cssxref("writing-mode")}}, {{cssxref("text-combine-upright")}}, and {{cssxref("unicode-bidi")}}.</li> + <li><a href="/docs/Web/CSS/CSS_Logical_Properties">CSS Logical properties</a></li> + <li><a href="https://www.w3.org/International/articles/vertical-text/">Styling vertical text (Chinese, Japanese, Korean and Mongolian)</a></li> + <li>Extensive browsers support test results: <a href="https://w3c.github.io/i18n-tests/results/horizontal-in-vertical.html#text_orientation">https://w3c.github.io/i18n-tests/results/horizontal-in-vertical.html#text_orientation</a></li> +</ul> |