- 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 - <embed> Tag
The <embed> tag is used as a container for external applications, multimedia, and interactive content that the browser don't understand. For their proper presentation, special programs or external plug-ins must be attached. The file type, attribute of the <embed> tag, and browser plugins installed all have a role in how embedded content is displayed.
Although HTML5's newly added <audio> and <video> elements are specifically used to embed multimedia in HTML documents, the <embed> element can be used to incorporate both third-party apps and multimedia content.
Syntax
Following is the syntax of <embed> tag −
<embed src=" " ></embed>
Specific Attributes
The HTML <object> tag also supports the following additional attributes −
S.No. | Attribute | Value & Description |
---|---|---|
1 | height |
pixels Specifies the height. |
2 | src |
URL Specifies the address of the source file. |
3 | type |
MIME_type Specifies the MIME type. |
4 | width |
pixels Specifies the width. |
Example
Let’s look at the basic example where we are going to embed an image on the webpage.
<!DOCTYPE html> <html> <head> <style> h2 { color: #DE3163; } p { color: #7D3C98; font-style: verdana; } </style> </head> <body> <embed src="https://www.tutorialspoint.com/cg/images/logo.png" height="30" width="200"></embed> <h2>Welcome To The TutorialsPoint</h2> <p>The Best E-Way Learning</p> </body> </html>
When we execute the above code, it will generate an output consisting of the image along with text embedded on the webpage.
Example
Following is an example where we are going to use the HTML <embed> tag to place audio on the page.
<!DOCTYPE html> <html> <body style="background-color:#EAFAF1 "> <embed type="audio/mpeg" src="https://samplelib.com/lib/preview/mp3/sample-3s.mp3"> </body> </html>
On running the above code, the output window will pop up, displaying the audio file displayed on the webpage.
Example
Consider another scenario where we are going to use the HTML <embed> tag to embed a video.
<!DOCTYPE html> <html> <body> <embed type="video/webm" src="https://cdn.pixabay.com/vimeo/862152022/bees-179480.mp4?width=640&hash=2e72975d6d298e9d485126a9260f5f539eb13337" width="400" height="300"> </body> </html>
When we execute the above code, it will generate an output consisting of a video uploaded to the webpage.