HTML <embed>
Tag
The <embed>
tag provides a container for an external resource
It is recommended to use the alternative tags where specific elements are available.
To embed a image, use the <img>
tag or <picture>
tag.
To embed a audio, use the <audio>
tag.
To embed a video, use the <video>
tag.
To embed a HTML, use the <iframe>
tag
To embed a Object, use the <object>
tag.
Element Attributes
Attribute | Value | Description |
---|---|---|
height |
pixels | This specifies the displayed height of the resource. |
src |
url | This specifies the URL of the embedded resource. |
type |
media_type | Specifies the MIME type to use to. |
width |
pixels | Specifies the displayed width of the resource. |
Global attributes
Global attributes may be applied on all elements, although some elements may have no effect on them.
<accesskey>
,
<class>
,
<contenteditable>
,
<contextmenu>
,
<data-*>
,
<dir>
,
<draggable>
,
<dropzone>
,
<hidden>
,
<id>
,
<lang>
,
<spellcheck>
,
<style>
,
<tabindex>
,
<title>
,
<translate>
.
Global Event Handler Attributes
Global Event Handler attributes may be applied on all elements, although some elements may have no effect on them.
<onabort>
,
<onautocomplete>
,
<onautocompleteerror>
,
<onblur>
,
<oncancel>
,
<oncanplay>
,
<oncanplaythrough>
,
<onchange>
,
<onclick>
,
<onclose>
,
<oncontextmenu>
,
<oncuechange>
,
<ondblclick>
,
<ondrag>
,
<ondragend>
,
<ondragenter>
,
<ondragleave>
,
<ondragover>
,
<ondragstart>
,
<ondrop>
,
<ondurationchange>
,
<onemptied>
,
<onended>
,
<onerror>
,
<onfocus>
,
<oninput>
,
<oninvalid>
,
<onkeydown>
,
<onkeypress>
,
<onkeyup>
,
<onload>
,
<onloadeddata>
,
<onloadedmetadata>
,
<onloadstart>
,
<onmousedown>
,
<onmouseenter>
,
<onmouseleave>
,
<onmousemove>
,
<onmouseout>
,
<onmouseover>
,
<onmouseup>
,
<onmousewheel>
,
<onpause>
,
<onplay>
,
<onplaying>
,
<onprogress>
,
<onratechange>
,
<onreset>
,
<onresize>
,
<onscroll>
,
<onseeked>
,
<onseeking>
,
<onselect>
,
<onshow>
,
<onsort>
,
<onstalled>
,
<onsubmit>
,
<onsuspend>
,
<ontimeupdate>
,
<ontoggle>
,
<onvolumechange>
,
<onwaiting>
.
Learning with HTML Editor "Try it Now"
You can edit the HTML code and view the result using online editor.
Example
<h3>Document in embed</h3>
<div>
<embed type="text/html" src="index.jsp" width="500" height="200"></embed>
</div>
<h3>Media in embed</h3>
<div>
<embed type="text/html" src="https://www.youtube.com/embed/RL4CyCvt6aw" width="500" height="200"></embed>
</div>
Click on the "Try it Now" button to see how it works.