HTML - <embed> Tag



HTML <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

<embed src=" " ></embed>

Attribute

HTML embed tag supports Global and Event attributes of HTML. Accepts some specific attributes as well which is listed below.

Attribute Value Description
height pixels Specifies the height of embeded content.
src URL Specifies the URL of embeded content
type MIME_type Specifies the MIME type of embeded content
width pixels Specifies the width of embeded content

Examples of HTML embed Tag

Bellow examples will illustrate the usage of embed tag. Where, when and how to use embed tag to embed image, html page, video or audio.

Embeding image using embed Tag

Let’s look at the basic example where we are going to embed an image on the webpage. We recomend you to use <img> tag to display images.

<!DOCTYPE html>
<html>
<body>
   <embed src=
"https://www.tutorialspoint.com/cg/images/logo.png"
          height="30" width="200">
   </embed>
</body>
</html>

Embeding audio using embed Tag

Following is an example where we are going to use the HTML <embed> tag to place audio on the page. We recomend you to use <audio> tag to display audio.

<!DOCTYPE html>
<html>
<body>
   <embed type="audio/mpeg" 
          src=
"https://samplelib.com/lib/preview/mp3/sample-3s.mp3">
</body>
</html>

Embeding video using embed Tag

Consider another scenario where we are going to use the HTML <embed> tag to embed a video. We recomend you to use <video> tag to display video.

<!DOCTYPE html>
<html>
<body>
   <embed type="video/webm" 
          src=
"https://www.youtube.com/embed/9ZXZFVZviK4?si=D04mP_FPlyQTl6tL"
          width="400" height="300">
</body>
</html>

Embeding html page using embed Tag

Consider another scenario where we are going to use the HTML <embed> tag to embed a html page. We recomend you to use <iframe> tag to display html page.

<!DOCTYPE html>
<html>
<body>
   <embed type="text/html" src="/index.htm" width="500" height="200">
</body>
</html>

Supported Browsers

Tag Chrome Edge Firefox Safari Opera
embed Yes Yes Yes Yes Yes
html_tags_reference.htm
Advertisements