1 Star 0 Fork 1

小弟调调 / html-tutorial

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
embed.md 2.12 KB
AI 代码解读
一键复制 编辑 原始数据 按行查看 历史
小弟调调 提交于 2022-05-04 01:20 . doc: update document.

HTML <embed> 标签

示例

嵌入图像:

<embed type="image/jpg" src="../assets/editors-006.png" width="300" height="160">

嵌入的 HTML 页面:

<embed type="text/html" src="./dt.html" width="500" height="200">

嵌入视频:

<embed type="video/webm" src="video.mp4" width="400" height="300">

定义和用法

<embed> 标签定义了外部资源的容器,例如网页、图片、媒体播放器或插件应用程序。

警告 ⚠️

大多数浏览器不再支持 Java 小程序和插件。

任何浏览器都不再支持 ActiveX 控件。

现代浏览器也关闭了对 Shockwave Flash 的支持。

建议

要显示图片,最好使用 <img> 标签。

要显示 HTML,最好使用 <iframe> 标签。

要显示视频或音频,最好使用 <video><audio> 标签。

浏览器支持

Element chrome edge firefox safari opera
<embed> Yes Yes Yes Yes Yes

属性 Attributes

属性 Attribute 值 Value 描述 Description
height pixels 指定嵌入内容的高度
src URL 指定要嵌入的外部文件的地址
type media_type 指定嵌入内容的媒体类型
width pixels 指定嵌入内容的宽度

全局属性

<embed> 标签支持 HTML 中的全局属性

事件属性

<embed> 标签支持 HTML 中的事件属性

默认 CSS 设置

大多数浏览器将显示具有以下默认值的 <embed> 元素:

embed:focus {
  outline: none;
}
1
https://gitee.com/jaywcjlove/html-tutorial.git
git@gitee.com:jaywcjlove/html-tutorial.git
jaywcjlove
html-tutorial
html-tutorial
main

搜索帮助