diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/zh-cn/web/html/element/embed | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/zh-cn/web/html/element/embed')
-rw-r--r-- | files/zh-cn/web/html/element/embed/index.html | 106 |
1 files changed, 106 insertions, 0 deletions
diff --git a/files/zh-cn/web/html/element/embed/index.html b/files/zh-cn/web/html/element/embed/index.html new file mode 100644 index 0000000000..6733e70d96 --- /dev/null +++ b/files/zh-cn/web/html/element/embed/index.html @@ -0,0 +1,106 @@ +--- +title: <embed>:外部内容嵌入元素 +slug: Web/HTML/Element/embed +tags: + - HTML + - HTML5 + - Web + - 嵌入 +translation_of: Web/HTML/Element/embed +--- +<p><strong>HTML <code><embed></code> 元素</strong>将外部内容嵌入文档中的指定位置。此内容由外部应用程序或其他交互式内容源(如浏览器插件)提供。</p> + +<p>{{Note("这篇文档仅定义该元素在 HTML5 中定义的部分,不包含该元素之前的声明内容和非标准的实现。")}}</p> + +<p>请记住,大多数现代浏览器已经弃用并取消了对浏览器插件的支持,所以如果您希望您的网站可以在普通用户的浏览器上运行,那么依靠 <code><embed></code> 通常是不明智的。</p> + +<table class="properties"> + <tbody> + <tr> + <th scope="row"><a href="/en-US/docs/HTML/Content_categories">Content categories</a></th> + <td><a href="/en-US/docs/HTML/Content_categories#Flow_content">Flow content</a>, <a href="/en-US/docs/HTML/Content_categories#Phrasing_content">phrasing content</a>, embedded content, interactive content, palpable content.</td> + </tr> + <tr> + <th scope="row">Permitted content</th> + <td>None, it is an {{Glossary("empty element")}}.</td> + </tr> + <tr> + <th scope="row">Tag omission</th> + <td>Must have a start tag, and must not have an end tag.</td> + </tr> + <tr> + <th scope="row">Permitted parents</th> + <td>Any element that accepts embedded content.</td> + </tr> + <tr> + <th scope="row">Permitted ARIA roles</th> + <td>{{ARIARole("application")}}, {{ARIARole("document")}}, {{ARIARole("img")}}, {{ARIARole("presentation")}}</td> + </tr> + <tr> + <th scope="row">DOM interface</th> + <td>{{domxref("HTMLEmbedElement")}}</td> + </tr> + </tbody> +</table> + +<h2 id="属性">属性</h2> + +<p>这个元素的属性包括 <a href="/en-US/docs/HTML/Global_attributes">全局属性</a>。</p> + +<dl> + <dt>{{htmlattrdef("height")}}</dt> + <dd>资源显示的高度,in <a href="https://drafts.csswg.org/css-values/#px">CSS pixels</a>. -- (Absolute values only. <a href="https://html.spec.whatwg.org/multipage/embedded-content.html#dimension-attributes">NO percentages</a>)</dd> + <dt>{{htmlattrdef("src")}}</dt> + <dd>被嵌套的资源的URL。</dd> + <dt>{{htmlattrdef("type")}}</dt> + <dd>用于选择插件实例化的 MIME 类型。</dd> + <dt>{{htmlattrdef("width")}}</dt> + <dd>资源显示的宽度,in <a href="https://drafts.csswg.org/css-values/#px">CSS pixels</a>. -- (Absolute values only. <a href="https://html.spec.whatwg.org/multipage/embedded-content.html#dimension-attributes">NO percentages</a>)</dd> +</dl> + +<h2 id="例子">例子</h2> + +<pre class="brush: html"><embed type="video/quicktime" src="movie.mov" width="640" height="480"> +</pre> + +<h2 id="规范">规范</h2> + +<table class="standard-table"> + <thead> + <tr> + <th scope="col">规范</th> + <th scope="col">状态</th> + <th scope="col">备注</th> + </tr> + </thead> + <tbody> + <tr> + <td>{{SpecName('HTML WHATWG', 'embedded-content.html#the-embed-element', '<embed>')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td> </td> + </tr> + <tr> + <td>{{SpecName('HTML5 W3C', 'embedded-content-0.html#the-embed-element', '<embed>')}}</td> + <td>{{Spec2('HTML5 W3C')}}</td> + <td> </td> + </tr> + </tbody> +</table> + +<h2 id="浏览器兼容性">浏览器兼容性</h2> + +<div class="note"> +<p><strong>注意</strong>: 不同浏览器之间显示有差异。Blink 内核浏览器(Chrome,Opera)会显示 HTML 资源的内容,但 Firefox 会显示一条通知消息,指出内容需要一个插件(见 {{Bug("730768")}})。建议使用 <object> 或 <iframe> 元素。</p> +</div> + + + +<p>{{Compat("html.elements.embed")}}</p> + +<h2 id="参见">参见</h2> + +<ul> + <li>其他用于嵌入各种类型内容的元素还包括:{{HTMLElement("audio")}}, {{HTMLElement("canvas")}}, {{HTMLElement("iframe")}}, {{HTMLElement("img")}}, {{MathMLElement("math")}}, {{HTMLElement("object")}}, {{SVGElement("svg")}} 和 {{HTMLElement("video")}}.</li> +</ul> + +<p>{{ HTMLRef }}</p> |