【发布时间】:2014-07-01 19:00:47
【问题描述】:
我已阅读 on Mozilla website regarding the title attribute : "contains a text representing advisory information related to the element it belongs to"。
而且,在页面的第一段关于所有全局属性(包括title):“HTML defines a few attributes that are common to all HTML elements. These attributes can be used on all elements, though the attributes may have no effect on some elements"
是否在任何地方指定(请提供来源)title 属性对哪个元素“无效”?
我很好奇为什么这看起来如此模糊,也许我只是错过了一些东西。
I created a jsfiddle 其中title 属性似乎对标签“有影响”(在 Chrome、FF29、IE11 上):<a>、<img>、<p>、<div>
【问题讨论】:
-
阅读每个标签的文档。他们告诉您哪些属性对其有效。浏览器对您提供的(无效)HTML 的选择取决于它们,并且会有所不同,不一定遵循标准。
-
在 HTML5 中不是对所有标签都有效吗?
-
@JohnConde 好的,这很有趣。因此,如果我想将它应用到标签上并检查它是否真的被我想在我的网络应用程序中支持的所有浏览器使用,我需要继续每个相关的浏览器文档并确保它的行为预期的?似乎这个属性最初是为 SEO 目的而提供的,最终被“某些”浏览器用来向用户显示这个“潜在的附加”信息......
标签: html