From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- files/zh-cn/web/html/element/caption/index.html | 151 ++++++++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 files/zh-cn/web/html/element/caption/index.html (limited to 'files/zh-cn/web/html/element/caption/index.html') 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: +slug: Web/HTML/Element/caption +translation_of: Web/HTML/Element/caption +--- +

简介

+ +

HTML <caption> 元素 (or HTML 表格标题元素) 展示一个表格的标题, 它常常作为 {{HTMLElement("table")}} 的第一个子元素出现,同时显示在表格内容的最前面,但是,它同样可以被CSS样式化,所以,它同样可以出现在任何一个一个相对于表格的做任意位置。

+ + + + + + + + + + + + + + + + + + + + + + + + +
Content categoriesNone.
Permitted contentFlow content.
Tag omission{{no_tag_omission}}
Permitted parent elementsA {{HTMLElement("table")}} element, as its first descendant.
DOM interface{{domxref("HTMLTableCaptionElement")}}
+ +

特性

+ +

本元素包含了所有 全局特性

+ +
+
{{htmlattrdef("align")}} {{deprecatedGeneric('inline','HTML4.01')}} {{obsoleteGeneric('inline','HTML5')}}
+
这个可枚举属性表明了caption相对于table应该如何排列。它可能有以下几个值: +
    +
  • left, 展示在表格左边
  • +
  • top, 显示在表格前面
  • +
  • right, 显示在表格右边
  • +
  • bottom, 显示在表格下面
  • +
+ +
使用说明:不要使用这个属性,它已经被弃用: {{HTMLElement("caption")}} 元素应该使用 CSS设置样式。要得到类似align属性的效果,使用 CSS 属性 {{cssxref("caption-side")}} 和 {{cssxref("text-align")}}.
+
+
+ +

使用说明

+ +

当 {{HTMLElement("table")}} 元素是{{HTMLElement("caption")}} 的父元素,caption是{{HTMLElement("figure")}} 元素的唯一后代的时候,使用{{HTMLElement("figcaption")}}元素替代caption元素

+ +

实例

+ +

请查看 {{HTMLElement("table")}} 页面获得 {{HTMLElement("caption")}}的例子

+ +

Specifications

+ + + + + + + + + + + + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName('HTML WHATWG', 'tabular-data.html#the-caption-element', '<caption>')}}{{Spec2('HTML WHATWG')}} 
{{SpecName('HTML5 W3C', 'tabular-data.html#the-caption-element', '<caption>')}}{{Spec2('HTML5 W3C')}} 
{{SpecName('HTML4.01', 'struct/tables.html#h-11.2.2', '<caption>')}}{{Spec2('HTML4.01')}} 
+ +

Browser compatibility

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatGeckoDesktop("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + +
FeatureAndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatGeckoMobile("1.0")}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

See also

+ + + +

{{HTMLRef}}

-- cgit v1.2.3-54-g00ecf