aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/html/global_attributes/title
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/global_attributes/title
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/global_attributes/title')
-rw-r--r--files/zh-cn/web/html/global_attributes/title/index.html140
1 files changed, 140 insertions, 0 deletions
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
+---
+<p>{{HTMLSidebar("Global_attributes")}}</p>
+
+<p><span class="seoSummary"><strong>title</strong> <a href="/en-US/docs/Web/HTML/Global_attributes">全局属性</a> 包含了表示咨询信息文本,和它属于的元素相关。这个信息通常存在,但绝不必要,作为提示信息展示给用户。一些典型用例:</span></p>
+
+<ul>
+ <li>链接:被链接文档的标题或描述</li>
+ <li>媒体元素,例如图像:描述或关联信息</li>
+ <li>段落:脚注或者相关的评论</li>
+ <li>引用:作者信息,以及其他</li>
+</ul>
+
+<p>如果省略了这个属性,就意味着这个元素的最近祖先的标题仍然是相关的(并且可以用作元素的提示信息)。如果这个属性设为空字符串,它就明确意味着,它的最近祖先的标题是不相关的(并且不应用于这个元素的提示信息)。</p>
+
+<p>额外的语义可以附加到 {{ HTMLElement("link") }},{{ HTMLElement("abbr") }},{{ HTMLElement("input") }} 和 { HTMLElement("menuitem") }} 元素的 <strong>title</strong> 属性。</p>
+
+<p><strong>title</strong> 属性可以包含多行。每个插入的 <code>U+000A LINE FEED</code> (<code>LF</code>) 代表一个换行。有一些需要注意的东西,因为这意味着:</p>
+
+<pre class="brush: html">&lt;p&gt;Newlines in title should be taken into account,like this &lt;abbr title="This is a
+multiline title"&gt;example&lt;/abbr&gt;.&lt;/p&gt;
+</pre>
+
+<p>这个示例定义了两行的标题。</p>
+
+<h2 id="规范">规范</h2>
+
+<table class="standard-table">
+ <tbody>
+ <tr>
+ <th scope="col">格式</th>
+ <th scope="col">状态</th>
+ <th scope="col">注释</th>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML WHATWG', "elements.html#the-title-attribute", "title")}}</td>
+ <td>{{Spec2('HTML WHATWG')}}</td>
+ <td>No change from latest snapshot, {{SpecName('HTML5.1')}}</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML5.1', "dom.html#the-title-attribute", "title")}}</td>
+ <td>{{Spec2('HTML5.1')}}</td>
+ <td>Snapshot of {{SpecName('HTML WHATWG')}}, no change from {{SpecName('HTML5 W3C')}}</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML5 W3C', "dom.html#the-title-attribute", "title")}}</td>
+ <td>{{Spec2('HTML5 W3C')}}</td>
+ <td>Snapshot of {{SpecName('HTML WHATWG')}}. From {{SpecName("HTML4.01")}}, it is now a true global attribute.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName('HTML4.01', 'struct/global.html#adef-title', 'title')}}</td>
+ <td>{{Spec2('HTML4.01')}}</td>
+ <td>Supported on all elements but {{HTMLElement("base")}}, {{HTMLElement("basefont")}}, {{HTMLElement("head")}}, {{HTMLElement("html")}}, {{HTMLElement("meta")}}, {{HTMLElement("param")}}, {{HTMLElement("script")}}, and {{HTMLElement("title")}}.</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="浏览器兼容性">浏览器兼容性</h2>
+
+<p>{{ CompatibilityTable() }}</p>
+
+<div id="compat-desktop">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>特征</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>{{ CompatVersionUnknown }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ </tr>
+ <tr>
+ <td>Multi-line support</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{CompatGeckoDesktop(12)}}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<div id="compat-mobile">
+<table class="compat-table">
+ <tbody>
+ <tr>
+ <th>Feature</th>
+ <th>Android</th>
+ <th>Chrome for 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>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ <td>{{ CompatVersionUnknown() }}</td>
+ </tr>
+ <tr>
+ <td>Multi-line support</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatGeckoMobile(12)}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ <td>{{CompatUnknown}}</td>
+ </tr>
+ </tbody>
+</table>
+</div>
+
+<h2 id="另见">另见</h2>
+
+<ul>
+ <li>所有<a href="/en-US/docs/Web/HTML/Global_attributes">全局属性</a></li>
+ <li>反映这个属性的 {{domxref("HTMLElement.title")}} </li>
+</ul>