HTML 5 <object> Tag
Example
How to use the object element to display Flash:
| <object data="helloworld.swf" /> |
Try it yourself »
|
Definition and Usage
The <object> tag is used to include objects such as images, audio, videos,
Java applets, ActiveX, PDF, and Flash.
The object element allows you to specify the data and parameters for
objects inserted into HTML documents, and the code that can be used to
display/manipulate that data.
Differences Between HTML 4.01 and HTML 5
Some HTML 4.01 attributes are not supported in HTML 5.
The "form" attribute is new in HTML 5.
Objects can be used and submitted in forms.
Tips and Notes
Note: An object element can appear inside the head or the body
element. The text between the <object> and </object> is the
alternate text, for browsers that do not support this tag. The <param>
tags define run-time settings for the object.
Tip: For images use the <img> tag instead of the <object>
tag.
Tip: At least one of the "data" and "type" attributes MUST be defined.
Attributes
| Attribute |
Value |
Description |
| data |
URL |
Defines a URL that refers to the object's data |
| form |
formname |
Defines one ore more forms the object belongs to. |
| height |
pixels |
Defines the height of the object |
| name |
unique_name |
Defines a unique name for the object (to use when a form is
submitted). |
| type |
MIME_type |
Defines the MIME type of data specified in the data attribute |
| usemap |
URL |
Specifies a URL of a client-side image map to be used with the object |
| width |
pixels |
Defines the width of the object |
Standard Attributes
| class, contenteditable, contextmenu, dir, draggable, id, irrelevant, lang, ref, registrationmark, tabindex, template, title |
For a full description, go to Standard Attributes in HTML 5.
Event Attributes
| onabort, onbeforeunload, onblur, onchange, onclick,
oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave,
ondragover, ondragstart, ondrop, onerror, onfocus, onkeydown, onkeypress,
onkeyup, onload, onmessage, onmousedown, onmousemove,
onmouseover, onmouseout, onmouseup, onmousewheel, onresize, onscroll, onselect,
onsubmit, onunload |
For a full description, go to Event Attributes in HTML 5.
Click here to design a Stunning Flash Website for Free
Wix is a revolutionary web design tool that provides anyone with the possibility to create professional and beautiful websites for free.
With e-commerce features, search engine visibility and many more professional tools, Wix is the ultimate solution for creating a spectacular site while saving tons of money.
|