Name

embed — HTML5

Synopsis

<embed> . . . </embed> (or <embed />)

Embeds an object into the web page. Embedded objects are most often multimedia files that use plug-in technology for playback (for example, Flash movies, QuickTime movies, and the like). In addition to the attributes listed below, certain media types and their respective plug-ins may have proprietary attributes for controlling the playback of the file.

Notes

Although commonly supported by browsers, the embed element was not part of the HTML 4.01 or earlier specifications (in favor of the object element for embedded media), however, it has been added to the HTML5 Working Draft. Because it was supported but not documented, it has many browser- and media-specific attributes and its syntax is not clear. Many developers use both object and embed for a single media object for backward compatibility, even though it does not conform to the HTML 4.01/XHTML standard.

Start/End Tags

There is conflicting documentation regarding whether embed is a container or an empty element. Modern browsers seem to support both methods, but including the closing tag is the safest bet. In HTML5, it is specified as an empty element.

HTML5 Attributes

HTML5 Global Attributes

height="number"

Specifies the height of the object in number of pixels. Some media types require this attribute.

src="URL"

Provides the location of the resource to be placed on the page.

width="number"

Specifies the width of the object in number of pixels. Some media types require this attribute. ...

Get HTML & XHTML Pocket Reference, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.