aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/css/direction
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/css/direction
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/zh-cn/web/css/direction')
-rw-r--r--files/zh-cn/web/css/direction/index.html93
1 files changed, 93 insertions, 0 deletions
diff --git a/files/zh-cn/web/css/direction/index.html b/files/zh-cn/web/css/direction/index.html
new file mode 100644
index 0000000000..16c0371860
--- /dev/null
+++ b/files/zh-cn/web/css/direction/index.html
@@ -0,0 +1,93 @@
+---
+title: direction
+slug: Web/CSS/direction
+translation_of: Web/CSS/direction
+---
+<div><span class="seoSummary">CSS属性 <strong><code>direction</code></strong> 用来设置文本、表列水平溢出的方向。</span>  <code>rtl</code> 表示从右到左 (类似希伯来语或阿拉伯语), <code>ltr</code> 表示从左到右 (类似英语等大部分语言).</div>
+
+<div> </div>
+
+<div>{{EmbedInteractiveExample("pages/css/direction.html")}}</div>
+
+
+
+<p>值得注意的是文本方向通常由文档定义 (e.g., with <a href="/en-US/docs/Web/HTML/Global_attributes/dir">HTML's <code>dir</code> attribute</a>)而不是通过直接使用 <code>direction</code> 属性定义。</p>
+
+<p>该属性设置可以设置块级元素文本的基本方向,也可以设置由通过 {{Cssxref("unicode-bidi")}}属性创建的嵌入元素的方向。与此同时,它还可以设置文本、块级元素的默认对齐方式 ,以及表行中的单元格的流动方向。</p>
+
+<p>与 HTML 中的 <code>dir</code> 属性不同,<code>direction</code>属性不会从表列继承到表单元格, 因为 CSS 继承遵从文档流, 而表单元格位于行内部, 但不在列内部。</p>
+
+<p><code>direction</code> 属性和 {{cssxref("unicode-bidi")}} 属性不受 {{cssxref("all")}} 属性影响。</p>
+
+<h2 id="语法">语法</h2>
+
+<pre class="brush:css no-line-numbers">/* Keyword values */
+direction: ltr;
+direction: rtl;
+
+/* Global values */
+direction: inherit;
+direction: initial;
+direction: unset;
+</pre>
+
+<h3 id="取值">取值</h3>
+
+<dl>
+ <dt><code>ltr</code></dt>
+ <dd>默认属性。可设置文本和其他元素的默认方向是从左到右。</dd>
+ <dt><code>rtl</code></dt>
+ <dd>可设置文本和其他元素的默认方向是从右到左。</dd>
+</dl>
+
+<h3 id="标准语法">标准语法</h3>
+
+<pre class="syntaxbox">{{csssyntax}}</pre>
+
+<h2 id="示例">示例</h2>
+
+<pre class="brush: css">blockquote {
+ direction: rtl;
+}
+</pre>
+
+<h2 id="Specification" name="Specification">规范</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', '#direction', 'direction')}}</td>
+ <td>{{Spec2('CSS3 Writing Modes')}}</td>
+ <td>No change.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('CSS2.1', 'visuren.html#direction', 'direction')}}</td>
+ <td>{{Spec2('CSS2.1')}}</td>
+ <td>Initial definition.</td>
+ </tr>
+ </tbody>
+</table>
+
+<p>{{cssinfo}}</p>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">浏览器兼容性</h2>
+
+<div>
+
+
+<p>{{Compat("css.properties.direction")}}</p>
+</div>
+
+<h2 id="参见">参见</h2>
+
+<ul>
+ <li>{{Cssxref("unicode-bidi")}}</li>
+ <li>{{Cssxref("writing-mode")}}</li>
+</ul>