<embed>:外部内容嵌入元素

HTML <embed> 元素将外部内容嵌入文档中的指定位置。此内容由外部应用程序或其他交互式内容源(如浏览器插件)提供。

备注: 这篇文档仅定义该元素在 HTML5 中定义的部分,不包含该元素之前的声明内容和非标准的实现。

请记住,大多数现代浏览器已经弃用并取消了对浏览器插件的支持,所以如果你希望你的网站可以在普通用户的浏览器上运行,那么依靠 <embed> 通常是不明智的。

Content categories (en-US) Flow content (en-US), phrasing content (en-US), embedded content, interactive content, palpable content.
Permitted content None, it is an empty element.
Tag omission Must have a start tag, and must not have an end tag.
Permitted parents Any element that accepts embedded content.
Permitted ARIA roles application (en-US), document (en-US), img (en-US), presentation (en-US)
DOM interface HTMLEmbedElement (en-US)

属性

这个元素的属性包括 全局属性 (en-US)

height

资源显示的高度,in CSS pixels. — (Absolute values only. NO percentages)

src

被嵌套的资源的 URL。

type

用于选择插件实例化的 MIME 类型。

width

资源显示的宽度,in CSS pixels. — (Absolute values only. NO percentages)

例子

html
<embed type="video/quicktime" src="movie.mov" width="640" height="480" />

规范

Specification
HTML Standard
# the-embed-element

浏览器兼容性

BCD tables only load in the browser

备注: 不同浏览器之间显示有差异。Blink 内核浏览器(Chrome,Opera)会显示 HTML 资源的内容,但 Firefox 会显示一条通知消息,指出内容需要一个插件(见 Firefox bug 730768)。建议使用 <object> 或 <iframe> 元素。

参见