html元素的title属性

来源:互联网 发布:宁夏国培网络研修 编辑:程序博客网 时间:2024/05/17 09:29

Title 属性

The title global attribute contains text representing advisory information, related to the element it belongs to. This information can be typically, but not necessarily, presented to the user as a tooltip. Some typical uses:

  • Link: title or description of the linked document
  • Media element like an image: description or associated credits
  • Paragraph: footnote or a commentary about it
  • Quotation: information about the author, and so on.

title 全局属性包含表示与其所属元素相关的咨询信息的文本.该信息通常但是不是必然地以工具提示的方式呈现给用户。一些典型带动用法:

  • Link: 与文档相联系的标题或者描述
  • 媒体元素就像图片元素: 描述或者与作者相关的东西
  • 段落: 脚注或者 关于该段落的评注
  • 引用: 关于作者或者其他内容的信息

If this attribute is omitted, it means that the title of the nearest ancestor of this element is still relevant (and could be used as the tooltip for that element). If this attribute is set to the empty string, it explicitly means its nearest ancestor’s title is not relevant (and shouldn’t be used in the tooltip for this element).

如果该属性被忽略,那么意味着距离这个元素最近的父代 title 属性仍然是与这个元素相关的(并且可以作为该元素的提示信息)。如果这个属性被赋值为空字符串,那么意味着该元素的最近的父级元素的 title 属性是不相关的(并且不可以作为这个元素的提示信息)

Additional semantics are attached to the title attributes of the <link>, <abbr>, <input> and <menuitem> elements.

附加语义附加到<link>,<input>和<menuitem>元素的标题属性。

The title attribute may contain several lines. Each U+000A LINE FEED (LF) inserted represents such a newline. Some caution must be taken, as this means:

title 属性可能包含几行。插入的每个U + 000A LINE FEED(LF)代表这样的换行符。必须谨慎,这意味着:

<!-- title的 multiline property 注意:1. 兼容性问题2. 在某个字符位置进行标注很方便。 --><p>Newlines in title should be taken into account,like this <abbr title="This is amultiline title">example</abbr>.</p>

This example defines a two-line title.

这个案例定义了一个三行的 title 属性

Browser compatibility

Desktop Mobile Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari Basic support (Yes) (Yes) (Yes) (Yes) (Yes) Multi-line support (Yes) 12 (12) (Yes) ? ?
原创粉丝点击