Skip to content
Related Articles

Related Articles

HTML | Object tag
  • Difficulty Level : Easy
  • Last Updated : 22 Aug, 2019
GeeksforGeeks - Summer Carnival Banner

The <object> tag is an HTML tag and used to display multimedia like audios, videos, images, PDFs, and Flash in web pages. It can also be used for displaying another webpage inside the HTML page.
The <param> tag is also used along with this tag to define various parameters. Any text that is written within <object> and </object> tags are considered as an alternative text that appears when the data specified is not supported by the browser.
This tag supports all Global and Event attributes of HTML.
Example:




<!DOCTYPE html>
<html>
  
<head>
    <title>Object Tag</title>
</head>
  
<body>
    <center>
        <h1>Object Tag</h1>
        <br>
    </center>
  
    <object data=
            width="550px" height="150px">GeeksforGeeks</object>
  
</body>
  
</html>                             

Output:
html object tag

The <object> tag has the following attributes:

AttributeValueDescription
dataURLIt specifies the URL of data in the object.
typemedia_typeIt specifies the media type of data specified in the data attribute.
typemustmatchbooleanIt indicates that the resource should be embedded only if the value of the type attribute matches with the type of the resource provided on the data attribute.
alignleft, right, top, bottomIt defines the alignment of the objects.
borderpixelsIt specifies the border around the object.
heightpixelsIt specifies the height of the object.
hspacepixelsIt specifies the whitespace on the left and right side of the object.
vspacepixelsIt specifies the whitespace on the top and bottom of the object.
heightpixelsIt specifies the height of the object.
widthpixelsIt specifies the width of the object.
namenameIt specifies the name for an object.
formform_idIt specifies the form id to which the object element belongs to.

Supported Browser: <object> tag supported by below browsers.

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

full-stack-img

My Personal Notes arrow_drop_up
Recommended Articles
Page :