W3Schools.com

HTML5 <object> Tag

Example

How to use the <object> element to embed a Flash file:

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

Try it yourself »

Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The <object> tag is supported in all major browsers.


Definition and Usage

The <object> tag defines an embedded object within an HTML document. Use this element to embed multimedia (like audio, video, Java applets, ActiveX, PDF, and Flash) in your web pages.

You can also use the <object> tag to embed another webpage into your HTML document.

You can use the <param> tag to pass parameters to plugins that have been embedded with the <object> tag.


Differences Between HTML 4.01 and HTML5

Some HTML 4.01 attributes are not supported in HTML5.

The "form" attribute is new in HTML5.

Objects can be used and submitted in forms.

Objects can no longer appear inside the <head> element of a document.


Tips and Notes

Note: An <object> element must appear inside the <body> element. The text between the <object> and </object> is an alternate text, for browsers that do not support this tag.

Tip: For images use the <img> tag instead of the <object> tag.

Tip: At least one of the "data" or "type" attribute MUST be defined.


Attributes

New : New in HTML5.

Attribute Value Description
align left
right
top
bottom
Not supported in HTML5
archive URL Not supported in HTML5
border pixels Not supported in HTML5
classid class_ID Not supported in HTML5
codebase URL Not supported in HTML5
codetype MIME_type Not supported in HTML5
data URL Specifies the URL of the resource to be used by the object
declare declare Not supported in HTML5
formNew form_id Specifies one or more forms the object belongs to
height pixels Specifies the height of the object
hspace pixels Not supported in HTML5
name name Specifies a name for the object
standby text Not supported in HTML5
type MIME_type Specifies the MIME type of data specified in the data attribute
usemap #mapname Specifies the name of a client-side image map to be used with the object
vspace pixels Not supported in HTML5
width pixels Specifies the width of the object

Global Attributes

The <object> tag also supports the Global Attributes in HTML5.


Event Attributes

The <object> tag also supports the Event Attributes in HTML5.


WEB HOSTING
Best Web Hosting
PHP MySQL Hosting
Best Hosting Coupons
UK Reseller Hosting
Cloud Hosting
Top Web Hosting
$7.95/mo SEO Hosting
Premium Website Design
WEB BUILDING
Download XML Editor
FREE Website BUILDER
Free Website Templates Free CSS Templates
Make Your Own Website
W3SCHOOLS EXAMS
Get Certified in:
HTML, CSS, JavaScript, XML, PHP, and ASP
W3SCHOOLS BOOKS
New Books:
HTML, CSS
JavaScript, and Ajax
STATISTICS
Browser Statistics
Browser OS
Browser Display
SHARE THIS PAGE