Name

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

Nonstandard. 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.

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.

The W3C recommends the object element for embedding media objects, but embed is still commonly used for backward compatibility. If you want the browser to prompt for a missing plug-in, you might need to break conformance and use embed . Many developers use both object and embed for a single media object.

Attributes

align="left|right|top|bottom"

Controls the alignment of the media object relative to the surrounding text. The default is bottom . While top and bottom are vertical alignments, left and right position the object on the left or right margin and allow text to wrap around it.

height="number"

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

hidden="yes|no"

Hides the media file or player from view when set to yes . The default is no.

name="text"

Specifies a name for the embedded object. This is particularly useful for referencing the object ...

Get HTML and XHTML Pocket Reference, 3rd 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.