Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

HTML <object> tag


May 04, 2021 HTML Reference Manual


Table of contents


HTML

A tag can represent an external resource that can be treated as an image, a nested browsing context, or a resource handled by a plug-in.

Join a Flash file in HTML using the element:

<object width="400" height="400" data="helloworld.swf"></object>

Try it out . . .

Browser support

HTML <object> tag HTML <object> tag HTML <object> tag HTML <object> tag HTML <object> tag

Most browsers currently support the label.


Label definition and instructions for use

Define an embedded object. U se this element to add multimedia to your XHTML page. This element allows you to specify the data and parameters of objects inserted into HTML documents, as well as the code that you can use to display and manipulate data.

Labels are used to contain objects such as images, audio, video, Java applets, ActiveX, PDFs, and Flash.

Object was originally intended to replace the img and applet elements. However, this has not been achieved due to vulnerabilities and a lack of browser support.

The browser's object support depends on the object type. Unfortunately, mainstream browsers use different code to load the same object type.

Fortunately, object objects provide a solution. I f the object element is not displayed, the code that is located between the . In this way, we are able to nest multiple object elements (one browser for each).


Tips and notes:

Tip: The label defines the run-time setting used for the object.

Tip: Do not use the label for the image, please use the label instead of the label.


The difference between HTML 4.01 and HTML5

Some HTML 4.01 properties are not supported in HTML5.

"form" is a new property defined by HTML5.

In HTML5, objects can be submitted in a form form.

In HTML5, objects no longer appear in the element area.


Property

New :HTML5 new property.

属性 描述
align topbottommiddleleftright HTML5 不支持。HTML 4.01 已废弃。 规定 <object> 元素相对于周围元素的对齐方式。
archive URL HTML5 不支持。 由空格分隔的指向档案文件的 URL 列表。这些档案文件包含了与对象相关的资源。
border pixels HTML5 不支持。HTML 4.01 已废弃。 规定 <object> 周围的边框宽度。
classid class_ID HTML5 不支持。 定义嵌入 Windows Registry 中或某个 URL 中的类的 ID 值,此属性可用来指定浏览器中包含的对象的位置,通常是一个 Java 类。
codebase URL HTML5 不支持。 定义在何处可找到对象所需的代码,提供一个基准 URL。
codetype MIME_type HTML5 不支持。 通过 classid 属性所引用的代码的 MIME 类型。
data URL 规定对象使用的资源的 URL。
declare declare HTML5 不支持。 定义该对象仅可被声明,但不能被创建或例示,直到该对象得到应用为止。
form New form_id 规定对象所属的一个或多个表单。
height pixels 规定对象的高度。
hspace pixels HTML5 不支持。HTML 4.01 已废弃。 规定对象左侧和右侧的空白。
name name 为对象规定名称。
standby text HTML5 不支持。 定义当对象正在加载时所显示的文本。
type MIME_type 规定 data 属性中规定的数据的 MIME 类型。
usemap #mapname 规定与对象一同使用的客户端图像映射的名称。
vspace pixels HTML5 不支持。HTML 4.01 已废弃。 规定对象的顶部和底部的空白。
width pixels 规定对象的宽度。


Global properties

The label supports global properties and views the full property sheet HTML global properties.


The event property

The label supports all HTML event properties.


Related articles

HTML tutorial: HTML Object element

HTML DOM Reference Manual: HTML DOM Object Object