aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/html/element/caption/index.html
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/caption/index.html
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/caption/index.html')
-rw-r--r--files/zh-cn/web/html/element/caption/index.html151
1 files changed, 151 insertions, 0 deletions
diff --git a/files/zh-cn/web/html/element/caption/index.html b/files/zh-cn/web/html/element/caption/index.html
new file mode 100644
index 0000000000..6afe7d92c3
--- /dev/null
+++ b/files/zh-cn/web/html/element/caption/index.html
@@ -0,0 +1,151 @@
+---
+title: <caption>
+slug: Web/HTML/Element/caption
+translation_of: Web/HTML/Element/caption
+---
+<h2 id="简介">简介</h2>
+
+<p><strong>HTML <code>&lt;caption&gt;</code> 元素</strong> (or <em>HTML 表格标题元素</em>) 展示一个表格的标题, 它常常作为 {{HTMLElement("table")}} 的第一个子元素出现,同时显示在表格内容的最前面,但是,它同样可以被CSS样式化,所以,它同样可以出现在任何一个一个相对于表格的做任意位置。</p>
+
+<table class="properties">
+ <tbody>
+ <tr>
+ <th scope="row"><a href="/en-US/docs/HTML/Content_categories" title="HTML/Content_categories">Content categories</a></th>
+ <td>None.</td>
+ </tr>
+ <tr>
+ <th scope="row">Permitted content</th>
+ <td><a href="/en-US/docs/HTML/Content_categories#Flow_content" title="HTML/Content categories#Flow content">Flow content</a>.</td>
+ </tr>
+ <tr>
+ <th scope="row">Tag omission</th>
+ <td>{{no_tag_omission}}</td>
+ </tr>
+ <tr>
+ <th scope="row">Permitted parent elements</th>
+ <td>A {{HTMLElement("table")}} element, as its first descendant.</td>
+ </tr>
+ <tr>
+ <th scope="row">DOM interface</th>
+ <td>{{domxref("HTMLTableCaptionElement")}}</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="特性">特性</h2>
+
+<p>本元素包含了所有 <a href="https://developer.mozilla.org/en-US/docs/HTML/Global_attributes" title="HTML/Global attributes">全局特性</a>。</p>
+
+<dl>
+ <dt>{{htmlattrdef("align")}} {{deprecatedGeneric('inline','HTML4.01')}} {{obsoleteGeneric('inline','HTML5')}}</dt>
+ <dd>这个可枚举属性表明了caption相对于table应该如何排列。它可能有以下几个值:
+ <ul>
+ <li><code>left</code>, 展示在表格左边</li>
+ <li><code>top</code>, 显示在表格前面</li>
+ <li><code>right</code>, 显示在表格右边</li>
+ <li><code>bottom</code>, 显示在表格下面</li>
+ </ul>
+
+ <div class="note"><strong>使用说明:</strong>不要使用这个属性,它已经被弃用: {{HTMLElement("caption")}} 元素应该使用 <a href="/en-US/docs/CSS" title="CSS">CSS</a>设置样式。要得到类似<code>align</code>属性的效果,使用 <a href="/en-US/docs/CSS" title="CSS">CSS</a> 属性 {{cssxref("caption-side")}} 和 {{cssxref("text-align")}}.</div>
+ </dd>
+</dl>
+
+<h2 id="使用说明">使用说明</h2>
+
+<p>当 {{HTMLElement("table")}} 元素是{{HTMLElement("caption")}} 的父元素,caption是{{HTMLElement("figure")}} 元素的唯一后代的时候,使用{{HTMLElement("figcaption")}}元素替代caption元素</p>
+
+<h2 id="实例">实例</h2>
+
+<p>请查看 {{HTMLElement("table")}} 页面获得 {{HTMLElement("caption")}}的例子</p>
+
+<h2 id="Specifications" name="Specifications">Specifications</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', 'tabular-data.html#the-caption-element', '&lt;caption&gt;')}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML5 W3C', 'tabular-data.html#the-caption-element', '&lt;caption&gt;')}}</td>
+ <td>{{Spec2('HTML5 W3C')}}</td>
+ <td> </td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML4.01', 'struct/tables.html#h-11.2.2', '&lt;caption&gt;')}}</td>
+ <td>{{Spec2('HTML4.01')}}</td>
+ <td> </td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility">Browser compatibility</h2>
+
+<p>{{CompatibilityTable}}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Chrome</th>
+ <th>Firefox (Gecko)</th>
+ <th>Internet Explorer</th>
+ <th>Opera</th>
+ <th>Safari</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatGeckoDesktop("1.0")}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Firefox Mobile (Gecko)</th>
+ <th>IE Mobile</th>
+ <th>Opera Mobile</th>
+ <th>Safari Mobile</th>
+ </tr>
+ <tr>
+ <td>Basic support</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatGeckoMobile("1.0")}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ <td>{{CompatVersionUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="See_also">See also</h2>
+
+<ul>
+ <li>其他与table相关的HTML元素: {{HTMLElement("col")}}, {{HTMLElement("colgroup")}}, {{HTMLElement("table")}}, {{HTMLElement("tbody")}}, {{HTMLElement("td")}}, {{HTMLElement("tfoot")}}, {{HTMLElement("th")}}, {{HTMLElement("thead")}}, {{HTMLElement("tr")}};</li>
+ <li>可能对{{HTMLElement("caption")}} 元素有用的CSS属性:
+ <ul>
+ <li>{{cssxref("text-align")}}, {{cssxref("caption-side")}}.</li>
+ </ul>
+ </li>
+</ul>
+
+<p>{{HTMLRef}}</p>