This page is In Progress

Notice: The WebPlatform project, supported by various stewards between 2012 and 2015, has been discontinued. This site is now available on github.

EMBED

Summary

The HTML <embed> Element represents an integration point for an external content- typically, non-HTML content such as an application or some other type of interactive content which involves use of a third-party plugin as a handler (rather than being natively supported by the UA).

Overview Table

DOM Interface
HTMLEmbedElement

Accessibility

Authors should ensure that the information and user interface components must be presentable to users in ways they can perceive (WCAG 2.0 - Principle 1: Perceivable). This includes providing alternatives for time-based media Guideline 1.2.

HTML Attributes

  • src = URL potentially surrounded by spaces
    gives the address of the resource being embedded.
  • type = MIME type
    Specifies the type of the resource.
  • width = non-negative integer
    Give the width of the visual content of the element, in CSS pixels.
  • height = non-negative integer
    Give the height of the visual content of the element, in CSS pixels.

History

While only being formalized as of HTML5, the tag has been informally supported among some user-agents as far back as Netscape Navigator 2.0 [1]

Examples

The following use of the EMBED element mimics the behavior of the BGSOUND tag.

<EMBED type="audio/x-midi" src="BackInTheSaddle.mid" hidden="true">

Way to embed a resource that requires a proprietary plugin, like Flash.If the user does not have the plugin (for example if the plugin vendor doesn’t support the user’s platform), then the user will be unable to use the resource.

<Embed src="catgame.swf">

To pass the plugin a parameter “quality” with the value "high", an attribute can be specified:

<Embed src="catgame.swf" quality="high">

Usage

 The interactive element embed must not appear as a descendant of the a element.

The interactive element embed must not appear as a descendant of the button element. The name attribute on the embed element is obsolete. Use the id attribute instead. The align attribute on the embed element is obsolete. Use CSS instead. The hspace attribute on the embed element is obsolete. Use CSS instead. The vspace attribute on the embed element is obsolete. Use CSS instead.

Notes

Remarks

The EMBED element must appear inside the BODY element of the document. Users need to have an application that can view the data installed on their computer. **Tip: ** In some cases, you may achieve better results by adding the file name extension of the add-on as a query parameter to the file name specified in the SRC attribute.

Permitted attributes - global attributes,& src ,& type, & height, & width, & Any other attribute that has no namespace.

Permitted parent elements Any element that can contain phrasing elements

Related specifications

HTML 5.1
W3C Working Draft
HTML 5
W3C Recommendation

See also

Related articles

HTML

Multimedia

Video

Attributions