HTML <object> tag
HTML <object> tag : Definition
• The <object> tag is used to embed another webpage into your HTML document, multimedia content such as a picture,an audio, media player, or a plug-in application into an HTML document etc.
• he <param> tag will be also used along with this tag to define various parameters.
Html <object> tag example 1: An embedded image:
<!DOCTYPE html> <html> <body> <h1>The object element example</h1> <object data="app-assets/images/course-images/html-tutorial.png" width="350" height="200"></object> </body> </html>
Output :
Html <object> tag example 2: An embedded video:
<!DOCTYPE html> <html> <body> <h1>The object element example</h1> <object data="try_it/media/tiger-roar.mp4" width="400" height="300"></object> </body> </html>
Output :
Attributes
Attribute | Value | Description |
---|---|---|
data | URL | URL of the resource to be used by the object |
form | form_id | Specifies which form the object belongs to |
height | pixels | Height of the object |
name | name | Defines a name for the object |
type | media_type | Media type of data specified in the data attribute |
typemustmatch | true/false | Specifies whether the type attribute and the actual content of the resource must match to be displayed |
usemap | #mapname | Name of a client-side image map to be used with the object |
width | pixels | Specifies the width of the object |