object
<object>
HTML<object>元素(或者称作HTML 嵌入对象元素)表示引入一个外部资源,这个资源可能是一张图片,一个嵌入的浏览上下文,亦或是一个插件所使用的资源。
内容类别 | Flow content; phrasing content; embedded content, palpable content; if the element has a usemap attribute, interactive content; listed, submittable form-associatedelement. |
---|---|
允许的内容 | 零个或多个<param>元素,然后是透明的。 |
标记遗漏 | 没有,起始和结束标签都是强制性的。 |
允许父母 | 任何接受嵌入内容的元素。 |
允许ARIA角色 | application, document, image |
DOM界面 | HTMLObjectElement |
属性
这个元素包含全局属性。
archive
HTML 4 only; HTML5已废弃,用来指名对象资源列表的以空格分隔的 URI 列表。
例子
嵌入一个Flash电影
<!-- Embed a flash movie -->
<object data="movie.swf"
type="application/x-shockwave-flash"></object>
<!-- Embed a flash movie with parameters -->
<object data="movie.swf" type="application/x-shockwave-flash">
<param name="foo" value="bar">
</object>
规范
Specification | Status | Comment |
---|---|---|
HTML Living StandardThe definition of '<object>' in that specification. | Living Standard | |
HTML5The definition of '<object>' in that specification. | Recommendation | |
HTML 4.01 SpecificationThe definition of '<object>' in that specification. | Recommendation | |
浏览器兼容性
Feature | Chrome | Edge | Firefox | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|---|
Basic Support | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
archive | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
border | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
classid | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
codebase | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
codetype | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
data | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
declare | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
form | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
height | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
name | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
standby | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
tabindex | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
type | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
typemustmatch | ? | No | 27 | ? | ? | ? |
usemap | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
width | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
Feature | Android | Chrome for Android | Edge mobile | Firefox for Android | IE mobile | Opera Android | iOS Safari |
---|---|---|---|---|---|---|---|
Basic Support | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
archive | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
border | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
classid | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
codebase | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
codetype | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
data | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
declare | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
form | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
height | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
name | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
standby | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
tabindex | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
type | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
typemustmatch | ? | ? | No | 27 | ? | ? | ? |
usemap | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |
width | (Yes) | (Yes) | (Yes) | 1 | (Yes) | (Yes) | (Yes) |