HTML <embed> tag


HTML <embed> tag is used to embed an external document in an HTML file which can be a third party application, multimedia, plugin(interactive content), etc. This element is new in HTML5.

Syntax:

<embed src=" " ></embed>   

Following are some specifications about the HTML <embed> tag

Displayblock
Start tag/End tagBoth Start and End tag
UsageEmbed third-party applications

Example 1:

<!DOCTYPE html>  
<html>  
<head>  
<title>Embed Tag</title>  
<style>  
    h2{  
    color: #cd5c5c;}  
    p{  
    color: #20b2aa;  
    font-style: italic;}  
 </style>  
</head>  
<body>  
<h2>Example of embed tag</h2>  
<p>The Dancing Penguin</p>  
<embed src="giphy.gif" height="200" width="300"></embed>  
</body>  
</html>  

Output:

HTML embed tag

Attribute

Tag-specific attribute

AttributeValueDescription
heightpixelsIt specifies the height of the embedded content
srcURLIt defines the resource location of the embedded document.
typemedia-typeIt specifies the MIME type.
widthpixelsIt determines the width of the embedded content.

Global attribute

The <embed> tag supports the global attributes in HTML

Event attribute

The <embed> tag supports the event attributes in HTML.

Supporting Browsers

Elementchrome browser Chromeie browser IEfirefox browser Firefoxopera browser Operasafari browser Safari
<embed>YesYesYesYesYes

Leave a Reply

Your email address will not be published. Required fields are marked *