166 Chapter 9 – Adding Images and Other Page Elements
Adding Media Files with
Web Design in a Nutshell, eMatter Edition
required plug-in should it not be found on the client machine. Netscape 4.0 intro-
duced thepluginurlattribute, which specifies a link to a function that installs the
plug-in automatically.
The complete list of attributes for the<embed>tag is detailed in the “Summary of
Object Placement Tags” section earlier in this chapter.
Plug-in-Specific Attributes
In addition to these standard attributes, the embed tag may also contain plug-in-
specific attributes for controlling the function of the player. The attributesloop,
autostart, autoplay, and volumeare examples of media-specific controls.
Complete<embed>tags with their respective attributes are listed for several media
types in Chapters 19, 20, and 21 of this book.
The<noembed> tag provides alternative content that displays if the browser
cannot display the specified media file. In the following example, the browser
would display the contents of the GIF file in place of the media object.
<EMBED SRC="url" HEIGHT="165" WIDTH="250" ALIGN="right"
HSPACE="6">
<NOEMBED><IMG SRC="needplugin.gif"></NOEMBED>
</EMBED>
Adding Media Files with
The<object>tag is an all-purpose object-placer. It can be used to place a variety
of object types, such as ActiveX controls, plug-in media, Java applets, images, and
more. The following shows the syntax of a simple<object> tag:
<OBJECT CLASSID="url" CODEBASE="url" DATA="url" TYPE="mimetype"
ID="name">
Theclassidis the URL of the object’s implementation (the program). It has the
same function as thecodeattribute of the<applet>tag when used for Java
applets. When used for a plug-in media type,classidfunctions like<embed>’s
pluginurlattribute, which points to the place where the appropriate plug-in can
be found and automatically installed.
Codebaseprovides the URL for the plug-in and functions, the same as thecode-
baseattribute in the<applet>tag. For plug-ins,codebaseis the same as the
pluginspage attribute.
Thedataattribute represents the URL of the object itself. It is equivalent to the
srcattribute for the<embed>tag. Thetypeattribute provides the MIME type of
the media object.
Objects placed with the<object>tag can be positioned with the standardalign
attribute, which has the same values as for the<img>tag. If the object is a plug-in,
thewidth andheight attributes may be required for the plug-in to function.