Skip to main content

HTML <embed> Tag

The HTML <embed> tag allows the embedding of external content, like video, sound, images, or browser plug-ins. It’s very useful in a wide range of use cases, such as displaying media files and animated content without requiring any additional plugins.

<embed type="video/webm" src="https://example.com/video.mp4"  width="460" height="200">
<embed src = "sound.mp3" type = "audio/mpeg">
<embed src="https://tleapps.com/wp-content/uploads/2022/02/Asset-10spear.png" width="260" height="260">

One of the main benefits of using the <embed> tag is that it allows web developers to easily incorporate multimedia content into their websites without the need for additional plugins or software. This can improve the user experience and make the website more interactive.

Here are brief descriptions of the four attributes of the <embed> tag:

  • height: This attribute specifies the height of the embedded content, in CSS pixels. It is used to set the height of the container for the embedded content.
  • src: This attribute specifies the URL of the resource to be embedded. The src attribute is required for the <embed> tag to function correctly.
  • type: This attribute specifies the MIME type of the resource being embedded. The MIME type helps the browser determine which plugin or software to use to display the resource.
  • width: This attribute specifies the width of the embedded content, in CSS pixels. It is used to set the width of the container for the embedded content.

Note that these attributes are optional, and their values can be specified in the style attribute or in an external stylesheet using CSS.