html元素的title属性

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 a
multiline title">example</abbr>.</p>

This example defines a two-line title.

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

Browser compatibility

DesktopMobile
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support(Yes)(Yes)(Yes)(Yes)(Yes)
Multi-line support(Yes)12 (12)(Yes)??
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值