HTML
<embed>
element
embeds external content at the specified point in the document. This content is provided by an external application or other source of interactive content such as a browser plug-in.
注意: This topic documents only the element that is defined as part of HTML5. It does not address earlier, non-standardized implementation of the element.
Keep in mind that most modern browsers have deprecated and removed support for browser plug-ins, so relying upon
<embed>
is generally not wise if you want your site to be operable on the average user's browser.
| 内容类别 | 流内容 , 措词内容 , embedded content, interactive content, palpable 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. |
| Implicit ARIA role | 无对应角色 |
| Permitted ARIA roles |
application
,
document
,
img
,
none
,
presentation
|
| DOM 接口 |
HTMLEmbedElement
|
This element's attributes include the 全局属性 .
height
src
The URL of the resource being embedded.
type
width
可以使用
object-position
property to adjust the positioning of the embedded object within the element's frame, and the
object-fit
property to control how the object's size is adjusted to fit within the frame.
<embed type="video/quicktime" src="movie.mov" width="640" height="480" title="Title of my video">
使用
title
属性
在
embed
element to label its content so that people navigating with assistive technology such as a screen reader can understand what it contains. The title's value should concisely describe the embedded content. Without a title, they may not be able to determine what its embedded content is. This context shift can be confusing and time-consuming, especially if the
embed
element contains interactive content like video or audio.
| 规范 | 状态 | 注释 |
|---|---|---|
|
HTML 实时标准
The definition of '<embed>' in that specification. |
实时标准 | |
|
HTML5
The definition of '<embed>' in that specification. |
推荐 |
注意 : Prior to version 45, Firefox did not display content of HTML resource, but a generic message saying the content needs a plug-in (see bug 730768 ).
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
embed
|
Chrome 完整支持 Yes | Edge 完整支持 12 | Firefox 完整支持 1 | IE 完整支持 Yes | Opera 完整支持 Yes | Safari 完整支持 Yes | WebView Android 完整支持 Yes | Chrome Android 完整支持 Yes | Firefox Android 完整支持 4 | Opera Android ? | Safari iOS ? | Samsung Internet Android 完整支持 Yes |
height
|
Chrome 完整支持 Yes | Edge 完整支持 12 | Firefox 完整支持 1 | IE 完整支持 Yes | Opera 完整支持 Yes | Safari 完整支持 Yes | WebView Android 完整支持 Yes | Chrome Android 完整支持 Yes | Firefox Android 完整支持 4 | Opera Android ? | Safari iOS ? | Samsung Internet Android 完整支持 Yes |
src
|
Chrome 完整支持 Yes | Edge 完整支持 12 | Firefox 完整支持 1 | IE 完整支持 Yes | Opera 完整支持 Yes | Safari 完整支持 Yes | WebView Android 完整支持 Yes | Chrome Android 完整支持 Yes | Firefox Android 完整支持 4 | Opera Android ? | Safari iOS ? | Samsung Internet Android 完整支持 Yes |
type
|
Chrome 完整支持 Yes | Edge 完整支持 12 | Firefox 完整支持 1 | IE 完整支持 Yes | Opera 完整支持 Yes | Safari 完整支持 Yes | WebView Android 完整支持 Yes | Chrome Android 完整支持 Yes | Firefox Android 完整支持 4 | Opera Android ? | Safari iOS ? | Samsung Internet Android 完整支持 Yes |
width
|
Chrome 完整支持 Yes | Edge 完整支持 12 | Firefox 完整支持 1 | IE 完整支持 Yes | Opera 完整支持 Yes | Safari 完整支持 Yes | WebView Android 完整支持 Yes | Chrome Android 完整支持 Yes | Firefox Android 完整支持 4 | Opera Android ? | Safari iOS ? | Samsung Internet Android 完整支持 Yes |
完整支持
兼容性未知
<audio>
,
<canvas>
,
<iframe>
,
<img>
,
<math>
,
<object>
,
<svg>
,和
<video>
.
object-position
and
object-fit