description & Usage
The <embed> tag is used to integrate external resources into an HTML document.
The <embed> tag can be used to display images, videos, audio, and web pages.
Here are some examples:
<embed type="image/jpg" src="/pic.jpg" width="300" height="200">
<embed type="video/webm" src="/video.mp4" width="400" height="300">
<embed type="text/html" src="/test.html" width="500" height="200">
Notes
Note: It is better to use the <img> tag for displaying images.
Note: It is better to use the <video> tag for displaying videos.
Note: It is better to use the <audio> tag for playing audio.
Note: It is better to use the <iframe> tag for embedding other web pages.
Browser compatibility and Support
# | Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
<embed> |
Attributes
Attributes | Values | Description |
---|---|---|
height |
pixels
|
Determines the height of the corresponding tags on the right. |
width |
pixels
|
Determines the width of the corresponding elements on the right. |
type |
media-type
|
Determines the type of the corresponding tags on the page. |
src |
URL
|
Specifies the source or URL of the audio and video media. |
Global Attributes
The <embed> tag supports the HTML Global Attributes.
Event Attributes
The <embed> tag supports the HTML Event Attributes.
Default CSS
Most browsers will display the <embed> tag with the following default style: