The embed tag in HTML5


The HTML <embed> tag is used for embedding another resource or interactive content into the document. The <embed> element is an empty element and this tag ending with the delimiter string />.This tag has no closing tag like <embed />. This tag is used to insert nonstandard elements content , typically a multimedia element that is not supported by HTML. You can use <embed > tag to add images, audio or video etc or you can write any thing in it.

Syntax :

<embed src="" type=""/>

This tag puts a browser plug-in in the page. A plug-in is a special program that adds specific abilities to a larger software application and it is located on the client computer not on your web server that handles its own special type of data file.

Attributes Introduced by HTML5
Attributes Values Description
src url This attribute specifies Address of resource file using URL.
type type This attribute used to specifies the MIME type of the embedded object and define type of media.
height pixels This attribute specifies the height of the embedded content.
width pixels This attribute specifies the width of the embedded content.


HTML5 Event Attributes

onabort onblur oncanplay
oncanplaythrough onchange onclick
oncontextmenu ondblclick ondrag
ondragend ondragenter ondragleave
ondragover ondragstart ondrop
ondurationchange onemptied onended
onerror onfocus onformchange
onforminput oninput oninvalid
onkeydown onkeypress onkeyup
onload onloadeddata onloadedmetadata
onloadstart onmousedown onmousemove
onmouseout onmouseover onmouseup
onmousewheel onpause onplay
onplaying onprogress onratechange
onreadystatechange onscroll onseeked
onseeking onselect onshow
onstalled onsubmit onsuspend
ontimeupdate onvolumechange onwaiting

Code:

<!DOCTYPE html>
<
html>
<
head>
    <title></title>

</
head>
<
body>
<
embed type="video/quicktime" src="mov/sample_sorenson.mov" width="340" height="250" />
<
br />
<
br />
<
br />
<
br />
<
embed src="Image/moonchilde.jpg" type="image"  height="400" width="400" />
</
body>
</
html>
  
Output

Fire Fox

embed-tag-in-html5.gif

Opera

embed tag

Safari

embed tag

Chrome

embed tag


embed tag


Up Next
    Ebook Download
    View all
    Learn
    View all