Open In App

HTML <embed> Tag

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Share
Report issue
Report

The <embed> tag in HTML is used for embedding external applications which are generally multimedia content like audio or video into an HTML document. It is used as a container for embedding plug-ins such as Flash animations. This tag is a new tag in HTML 5, and it requires only a starting tag.

Note: Modern browsers don’t support <embed>, Java Applets, ActiveX controls, and Shockwave Flash. Use Standard Elements Instead: Prefer <img> for images, <iframe> for HTML, <video>, and <audio> for displaying video or audio content.

Syntax: 

<embed attributes>

Attributes:

Attribute Values

Description

height

This attribute contains the attribute value in pixels. It is used to specify the height of the embedded content.

src

It is used to hold the URL. It is used to specify the web address of the embedded content.

width

The width value is set in pixels. It is used to specify the width of embedded content.

type

It contains the media_type content. It is used to specify the media type of the embedded content.

Example 1:  This program illustrates the <embed> element in HTM with an example

HTML




<!DOCTYPE html>
<html>
 
<head>
    <title>embed Tag</title>
    <style>
        q {
            color: #00cc00;
            font-style: italic;
        }
    </style>
</head>
 
<body>
    <q>GeeksforGeeks</q> is loading.
    <br>
    <embed src="loading2.swf"
    type="application/x-shockwave-flash">
</body>
 
</html>


Output: 

ezgifcom-video-to-gif-converter

Example 2: This example uses the width and height property with the <embed> tag. 

HTML




<!DOCTYPE html>
<html>
 
<head>
    <title>embed Tag</title>
    <style>
        q {
            color: #00cc00;
            font-style: italic;
        }
    </style>
</head>
 
<body>
    Click here to redirect to <q>GeeksforGeeks</q>
    <br>
    <embed src="animProps02.swf"
    width="30px" height="30px">
    <a href="http://geeksforgeeks.org">
        GeeksforGeeks
    </a>
</body>
 
</html>


Output: 

ezgifcom-video-to-gif-converter-(1)

Supported Browsers:

  • Google Chrome 1
  • Edge 12
  • Firefox 1
  • Opera 12.1
  • Safari 4


Last Updated : 28 Dec, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads