aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/html/element/sub
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/html/element/sub
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/html/element/sub')
-rw-r--r--files/zh-cn/web/html/element/sub/index.html86
1 files changed, 86 insertions, 0 deletions
diff --git a/files/zh-cn/web/html/element/sub/index.html b/files/zh-cn/web/html/element/sub/index.html
new file mode 100644
index 0000000000..f9f292daf5
--- /dev/null
+++ b/files/zh-cn/web/html/element/sub/index.html
@@ -0,0 +1,86 @@
+---
+title: <sub>
+slug: Web/HTML/Element/sub
+translation_of: Web/HTML/Element/sub
+---
+<p><strong>HTML <code>&lt;sub&gt;</code> 元素</strong>定义了一个文本区域,出于排版的原因,与主要的文本相比,应该展示得更低并且更小。</p>
+
+<table class="properties">
+ <tbody>
+ <tr>
+ <th scope="row"><a href="/en-US/docs/HTML/Content_categories" title="en/HTML/Content categories">内容分类</a></th>
+ <td>流式内容和短语内容</td>
+ </tr>
+ <tr>
+ <th scope="row">允许的内容</th>
+ <td>短语内容</td>
+ </tr>
+ <tr>
+ <th scope="row">标签省略</th>
+ <td>{{no_tag_omission}}</td>
+ </tr>
+ <tr>
+ <th scope="row">允许的父元素</th>
+ <td>可以包含短语内容的任意元素</td>
+ </tr>
+ <tr>
+ <th scope="row">允许的 ARIA 角色</th>
+ <td>任意     </td>
+ </tr>
+ <tr>
+ <th scope="row">DOM 接口</th>
+ <td>{{domxref("HTMLElement")}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="属性">属性</h2>
+
+<p>这个元素仅仅包含<a href="/en-US/docs/HTML/Global_attributes">全局属性</a>。</p>
+
+<h2 id="用法注解">用法注解</h2>
+
+<ul>
+ <li>这个元素应该只用于排版目的,也就是改变文本的位置会改变含义,例如在数学中(<var>t<sub>2</sub></var>,也可以考虑使用 <a href="/en-US/docs/MathML" title="en/MathML">MathML</a> 公式)或者化学符号( <code>H<sub>2</sub>O</code>)。</li>
+ <li>这个元素不能用于样式上的目的,比如产品名称 LaTeX 的样式,这时应该使用 <a href="/en-US/docs/CSS" title="en/CSS">CSS</a>样式: {{ cssxref("vertical-align") }} 属性的 <code>sub</code> 值能实现相同效果。</li>
+</ul>
+
+<h2 id="示例">示例</h2>
+
+<pre class="brush: html">&lt;p&gt;The chemical formula of water: H&lt;sub&gt;2&lt;/sub&gt;O&lt;/p&gt;
+</pre>
+
+<h4 id="结果">结果</h4>
+
+<p>The chemical formula of water: H<sub>2</sub>O</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('HTML WHATWG', 'semantics.html#the-sub-and-sup-elements', '&lt;sub&gt; and &lt;sup&gt;')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML5 W3C', 'textlevel-semantics.html#the-sub-and-sup-elements', '&lt;sub&gt; and &lt;sup&gt;;')}}</td>
+ <td>{{Spec2('HTML5 W3C')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="另见">另见</h2>
+
+<ul>
+ <li>{{ HTMLElement("sup") }} HTML 元素会产生上标。要注意,你不能同时使用它们,你需要 <a href="/en-US/docs/MathML" title="en/MathML">MathML</a> 来同时产生化学符号旁边的下标和上标,代表它的序号和核子数。</li>
+ <li><a href="/en-US/docs/MathML/Element/msub" title="en/MathML/Element/msub"><code>&lt;msub&gt;</code></a>, <a href="/en-US/docs/MathML/Element/msup" title="en/MathML/Element/msup"><code>&lt;msup&gt;</code></a>, 和 <a href="/en-US/docs/MathML/Element/msubsup" title="en/MathML/Element/msubsup"><code>&lt;msubsup&gt;</code></a> MathML 元素。</li>
+</ul>