HTML and CSS Reference
embedding Plug-in content
The <embed> tag was originally developed by Netscape as a proprietary tag — meaning not in the
HTML specification — to work with the plug-in architecture for its browser, Navigator. Although
Netscape Navigator is no more, Firefox — created by Netscape's spin-off company, Mozilla — con-
tinues to support the <embed> as well as the officially sanctioned <object> tag.
Unlike <object> , the <embed> tag does not require a closing tag. All attributes are contained within
the single tag and there is no way to include alternative content. Here's an example:
<embed src=”assets/mySounds.mp3” height=”60” width=”144”>
The src attribute contains the path to the associated file; the path can be either relative or absolute. The
height and width attributes are optional. Any plug-in-specific settings are entered as attributes within
the <embed> tag; there are no <param> tags as with the <object> tag. For example, here's how content
that requires the QuickTime plug-in might be coded with <embed> :
<embed src=”assets/weather.mov” width=”432” height=”376” autoplay=”true”
A web page with the preceding code — if the QuickTime plug-in is available to the browser — dis-
plays a QuickTime movie, complete with a control bar as shown in Figure 23-2.
Just to keep life interesting, HTML5 — as of this writing — recommends that a
new version of the <embed> tag by itself be the vehicle for delivering plug-in con-
tent, although the <object> tag is also included in the specification.