From 33058f2b292b3a581333bdfb21b8f671898c5060 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:40:17 -0500 Subject: initial commit --- .../web/html/global_attributes/title/index.html | 140 +++++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 files/zh-cn/web/html/global_attributes/title/index.html (limited to 'files/zh-cn/web/html/global_attributes/title') diff --git a/files/zh-cn/web/html/global_attributes/title/index.html b/files/zh-cn/web/html/global_attributes/title/index.html new file mode 100644 index 0000000000..73fbf8eda3 --- /dev/null +++ b/files/zh-cn/web/html/global_attributes/title/index.html @@ -0,0 +1,140 @@ +--- +title: title +slug: Web/HTML/Global_attributes/title +tags: + - HTML + - Reference + - Title + - 全局属性 +translation_of: Web/HTML/Global_attributes/title +--- +

{{HTMLSidebar("Global_attributes")}}

+ +

title 全局属性 包含了表示咨询信息文本,和它属于的元素相关。这个信息通常存在,但绝不必要,作为提示信息展示给用户。一些典型用例:

+ + + +

如果省略了这个属性,就意味着这个元素的最近祖先的标题仍然是相关的(并且可以用作元素的提示信息)。如果这个属性设为空字符串,它就明确意味着,它的最近祖先的标题是不相关的(并且不应用于这个元素的提示信息)。

+ +

额外的语义可以附加到 {{ HTMLElement("link") }},{{ HTMLElement("abbr") }},{{ HTMLElement("input") }} 和 { HTMLElement("menuitem") }} 元素的 title 属性。

+ +

title 属性可以包含多行。每个插入的 U+000A LINE FEED (LF) 代表一个换行。有一些需要注意的东西,因为这意味着:

+ +
<p>Newlines in title should be taken into account,like this <abbr title="This is a
+multiline title">example</abbr>.</p>
+
+ +

这个示例定义了两行的标题。

+ +

规范

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
格式状态注释
{{SpecName('HTML WHATWG', "elements.html#the-title-attribute", "title")}}{{Spec2('HTML WHATWG')}}No change from latest snapshot, {{SpecName('HTML5.1')}}
{{SpecName('HTML5.1', "dom.html#the-title-attribute", "title")}}{{Spec2('HTML5.1')}}Snapshot of {{SpecName('HTML WHATWG')}}, no change from {{SpecName('HTML5 W3C')}}
{{SpecName('HTML5 W3C', "dom.html#the-title-attribute", "title")}}{{Spec2('HTML5 W3C')}}Snapshot of {{SpecName('HTML WHATWG')}}. From {{SpecName("HTML4.01")}}, it is now a true global attribute.
{{SpecName('HTML4.01', 'struct/global.html#adef-title', 'title')}}{{Spec2('HTML4.01')}}Supported on all elements but {{HTMLElement("base")}}, {{HTMLElement("basefont")}}, {{HTMLElement("head")}}, {{HTMLElement("html")}}, {{HTMLElement("meta")}}, {{HTMLElement("param")}}, {{HTMLElement("script")}}, and {{HTMLElement("title")}}.
+ +

浏览器兼容性

+ +

{{ CompatibilityTable() }}

+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
特征ChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{ CompatVersionUnknown() }}{{ CompatVersionUnknown }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
Multi-line support{{ CompatVersionUnknown() }}{{CompatGeckoDesktop(12)}}{{ CompatVersionUnknown() }}{{CompatUnknown}}{{CompatUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}{{ CompatVersionUnknown() }}
Multi-line support{{CompatUnknown}}{{CompatUnknown}}{{CompatGeckoMobile(12)}}{{CompatUnknown}}{{CompatUnknown}}{{CompatUnknown}}
+
+ +

另见

+ + -- cgit v1.2.3-54-g00ecf