- HTML Tutorial
- HTML - Home
- HTML - History and Evolution
- HTML - Overview
- HTML - Editors
- HTML - Basic Tags
- HTML - Elements
- HTML - Attributes
- HTML - Formatting
- HTML - Headings
- HTML - Paragraphs
- HTML - Quotations
- HTML - Comments
- HTML - Phrase Tags
- HTML - Meta Tags
- HTML - Style Sheet
- HTML - CSS Classes
- HTML - CSS IDs
- HTML - Images
- HTML - Image Map
- HTML Tables
- HTML - Tables
- HTML - Headers & Caption
- HTML - Table Styling
- HTML - Table Colgroup
- HTML - Nested Tables
- HTML Lists
- HTML - Lists
- HTML - Unordered Lists
- HTML - Ordered Lists
- HTML - Definition Lists
- HTML Links
- HTML - Text Links
- HTML - Image Links
- HTML - Email Links
- HTML - Iframes
- HTML - Blocks
- HTML Backgrounds
- HTML - Backgrounds
- HTML Colors
- HTML - Colors
- HTML - RGB
- HTML - HEX
- HTML - HSL
- HTML Forms
- HTML - Forms
- HTML - Form Attributes
- HTML - Form Control
- HTML - Input Attributes
- HTML Media
- HTML - Video Element
- HTML - Audio Element
- HTML - Embed Multimedia
- HTML Header
- HTML - Head Element
- HTML - Adding Favicon
- HTML - Javascript
- HTML Layouts
- HTML - Layouts
- HTML - Layout Elements
- HTML - Layout using CSS
- HTML - Responsiveness
- HTML - Symbols
- HTML - Emojis
- HTML - Style Guide
- HTML Graphics
- HTML - SVG
- HTML - Canvas
- HTML APIs
- HTML - Geolocation API
- HTML - Drag & Drop API
- HTML - Web Workers API
- HTML - WebSocket
- HTML - Web Storage
- HTML - Server Sent Events
- HTML Miscellaneous
- HTML - MathML
- HTML - Microdata
- HTML - IndexedDB
- HTML - Web Messaging
- HTML - Web CORS
- HTML - Web RTC
- HTML Demo
- HTML - Audio Player
- HTML - Video Player
- HTML - Web slide Desk
- HTML Tools
- HTML - Velocity Draw
- HTML - QR Code
- HTML - Modernizer
- HTML - Validation
- HTML - Color Code Builder
- HTML References
- HTML - Tags Reference
- HTML - Attributes Reference
- HTML - Events Reference
- HTML - Fonts Reference
- HTML - ASCII Codes
- ASCII Table Lookup
- HTML - Color Names
- HTML - Entities
- MIME Media Types
- HTML - URL Encoding
- Language ISO Codes
- HTML - Character Encodings
- HTML - Deprecated Tags
- HTML Resources
- HTML - Quick Guide
- HTML - Useful Resources
- HTML - Color Code Builder
- HTML - Online Editor
HTML - <object> Tag
The <object> tag in HTML is used to show multimedia on web pages, including audio, video, pictures, PDFs, and Flash. Additionally, another website may be displayed inside the HTML page using this technique.
To define various parameters, the <param> tag is additionally used with this tag. Any text contained between the <object> tags is considered as alternative text, which is displayed when the browser does not support the data supplied.
Syntax
Following is the syntax of <object> tag −
<object data="" type=""></object>
Specific Attributes
The HTML <object> tag also supports the following additional attributes −
S.No. | Attribute & Description |
---|---|
1 | align Defines visual alignment of the object |
2 | archive A space separated list of URL's to archives. |
3 | border Specifies border width around the object |
4 | classid Defines a class ID value as set in the Windows Registry or a URL |
5 | codebase Specifies the path where object code is located. |
6 | codetype The internet media type of the code referred to by the classid attribute. |
Example
Let’s look at the following example, where we are going to embed an image.
<!DOCTYPE html> <html> <head> <title>HTML object Tag</title> </head> <body> <object data="/html/test.jpg" type="text/html" width="300" height="200"> alt : <a href="/html/images/logo.png">test.jpg</a> </object> </body> </html>
When we execute the above code, it will generate an output consisting of the image uploaded to the webpage.
Example
Consider another scenario where we are going to embed a video on the webpage.
<!DOCTYPE html> <html> <head> <title>Object Tag</title> </head> <body> <h2>Embedding the video</h2> <object height="250" width="500" data="https://cdn.pixabay.com/vimeo/497754241/laptop-61037.mp4?width=640&hash=d25d7f4b8afa862b3252bdaeaf157934ceb1bb72"></object> </body> </html>
On running the above, an output window will pop up consisting of the video along with text displayed on the webpage.