diff options
Diffstat (limited to 'files/zh-cn/web/html/element/sup/index.html')
| -rw-r--r-- | files/zh-cn/web/html/element/sup/index.html | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/files/zh-cn/web/html/element/sup/index.html b/files/zh-cn/web/html/element/sup/index.html new file mode 100644 index 0000000000..7fe91ff45a --- /dev/null +++ b/files/zh-cn/web/html/element/sup/index.html @@ -0,0 +1,88 @@ +--- +title: <sup> +slug: Web/HTML/Element/sup +translation_of: Web/HTML/Element/sup +--- +<p><strong>HTML <code><sup></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>f<sup>4</sup></var>,也可以考虑使用 <a href="/en-US/docs/MathML" title="en/MathML">MathML</a> 公式)或者在法语缩写中( M<sup>lle</sup>,M<sup>me</sup> 或者 C<sup>ie</sup>)。</li> + <li>这个元素不能用于样式上的目的,比如产品名称 LaTeX 的样式,这时应该使用 <a href="/en-US/docs/CSS" title="en/CSS">CSS</a>样式: {{ cssxref("vertical-align") }} 属性的 <code>super</code> 值能实现相同效果。</li> +</ul> + +<h2 id="示例">示例</h2> + +<pre class="brush: html"><p>This text is <sup>superscripted</sup></p> +</pre> + +<h4 id="结果">结果</h4> + +<p>This text is <sup>superscripted</sup></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', '<sub> and <sup>')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td> </td> + </tr> + <tr> + <td>{{SpecName('HTML5 W3C', 'textlevel-semantics.html#the-sub-and-sup-elements', '<sub> and <sup>;')}}</td> + <td>{{Spec2('HTML5 W3C')}}</td> + <td> </td> + </tr> + </tbody> +</table> + +<h2 id="另见">另见</h2> + +<ul> + <li>{{ HTMLElement("sub") }} 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><msub></code></a>, <a href="/en-US/docs/MathML/Element/msup" title="en/MathML/Element/msup"><code><msup></code></a>, 和 <a href="/en-US/docs/MathML/Element/msubsup" title="en/MathML/Element/msubsup"><code><msubsup></code></a> MathML 元素。</li> +</ul> + +<p>{{HTMLRef}}</p> |
