【发布时间】:2016-09-23 15:02:09
【问题描述】:
为什么在 object 标记中,用于插入外部资源的属性称为“data”而不是所有其他标记(audio、embed、iframe、img、input、script、source)中的“src” ,轨道,视频)?
例如:
Object tag: <object data="https://www.w3.org/html/logo/downloads/HTML5_Logo_512.png" width=50 height=50>
</object>
All other tags: <img src="https://www.w3.org/html/logo/downloads/HTML5_Logo_512.png" width=50 height=50>
因此,要在网页中输入相同的外部资源(例如,视频文件),您必须根据使用的标签(对象或视频)使用不同的属性。那么,造成这种差异的可能原因(我不怀疑有一个原因)是否重要到足以证明对简单性原则的例外?
谢谢。
朱里
【问题讨论】:
-
贴一个例子说明你的意思。
-
@Stormhashe: jsfiddle.net/rudijuri/99gym624
标签: html object attributes tags src