Attributes and usage of Html object tags

Source: Internet
Author: User

This is an article I have seen from other blogs, some of which are my own summaries, so I still want to locate the original and hope to provide more help to you.
Recently, I started to involve website knowledge and had to have a deeper understanding of html tags. I just saw a website that uses object tags to achieve some amazing results, so I searched for the relevant object content and wrote this blog post based on my own experiences.

HTML <object> tag

Definition and usage
Defines an embedded object. Use this element to add multimedia to your XHTML page. This element allows you to specify the data and parameters of objects inserted into the HTML document, as well as code that can be used to display and manipulate data.

<Object> tags are used to include objects, such as images, audios, videos, Java applets, ActiveX, PDF, and Flash.

The original intention of the object is to replace the img and applet elements. However, this is not implemented due to vulnerabilities and lack of browser support.

The support for browser objects depends on the object type. Unfortunately, mainstream browsers use different codes to load the same object type.

Fortunately, the object provides a solution. If the object element is not displayed, the code between <object> and </object> is executed. In this way, we can nest Multiple object elements (each corresponding to a browser ).

Add an object to HTML code:

Object tags can be used to implement flash animation with images.

<Object> attributes of a tag can be defined as long and wide as needed. Other values do not need to be added.

<Param value = "Path of the animation or image to be displayed"> </param>

<Param name = "vmode" value = "transparent"> </param> defines the transparency of two attributes.




Browser support
Almost all mainstream browsers partially support <object> tags.

Differences between HTML and XHTML

Tips and notes:
Note: The <param> label defines the run-time settings of the object.

Note: Do not use the <object> label for the image. Use the label instead.

Optional attributes
Attribute value description DTD
Defines the text alignment of the object. TF
An archive URL is a list of URLs that point to an archive file separated by spaces. These file files contain object-related resources. STF
Border pixels defines the border around the object. TF
Classid class ID defines the ID value of the class embedded in Windows Registry or in a URL. This attribute can be used to specify the location of the object contained in the browser, usually a Java class. STF
Codebase URL defines where the code required for an object can be found and provides a reference URL. STF
The codetype MIME type refers to the MIME type of the Code referenced by the classid attribute. STF
Data URL defines the URL of the referenced object data. If a data file needs to be processed by an object, use the data attribute to specify the data file. STF
Declare can define that this object can only be declared, but cannot be created or used as an example until this object is applied. STF
Height pixels defines the height of an object. STF
Heatace pixels defines the horizontal blank area around the object. TF
Name unique_name is the unique name defined by the object (for use in scripts ). STF
Standby text defines the text displayed when the object is being loaded. STF
Type MIME_type defines the MIME type of data that appears in the file specified in the data attribute. STF
Usemap URL specifies the client image ing URL used with the object. STF
Vspace pixels defines the vertical blank of the object. TF
Width pixels defines the width of an object. STF
Standard attributes
Id, class, title, style, dir, lang, xml: lang
Event attributes
Accesskey, tabindex, onclick, ondblclick, onmousedown, onmouseup,
Onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup

Author: putianchengp

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.