The EMBED element is the method used to integrate Netscape Plug-In
technology into a web page. The element has three mandatory attributes
[HEIGHT, SRC, and WIDTH] but it is extensible in that it also allows
any number of additional custom attributes that are dependent on the
Plug-In used. Any attributes present that the browser does not
understand are passed on to the plug-in for interpretation.
The browser should first try to determine which Plug-In to use based on
the file extension of the file in the SRC attribute (Netscape browsers
may also use the TYPE attribute to determine this.) If the browser can
not determine what Plug-In to use, it will then query the user to
determine what to do next.
Description:
This attribute specifies the alignment of text following the embedded
object relative to the object on the screen. Values of LEFT and RIGHT
specify floating horizontal alignment of the embedded object in the
browser window, and subsequent text will wrap around the object. The
other values specify vertical alignment of text relative to the object
on the same line.
Values:Left | Right |
Top | Texttop |
Middle | Absmiddle |
Baseline | Bottom |
Absbottom
Description:
Specifies the height of the embedded object on the screen.
Values:
Positive integers or a percentage of the screen/window to use. If
the UNITS attribute is not specified, the default measurement system
used for positive integers is pixels (px.)
Description:
Specifies whether the embedded object will be visible/rendered on the
page. A value of TRUE will override any HEIGHT/WIDTH attributes also
set and the rest of the page will be rendered as if the embedded object
does not exist in the document flow.
Description:
This attribute specifies the horizontal spacing (left and right padding)
around the embedded object using the unit system specified in the UNITS
attribute. Values are specified using positive integers.
Values:
Positive integer values. If the UNITS attribute is not specified, the
default measurement system is pixels (px.)
Description:
This attribute is windows-platform specific; it controls whether the
foreground or background palette is used by the plug-in to render the
embedded object.
Values: Background [DEFAULT] The
plug-in uses the background color palette to render the embedded object. Foreground The plug-in uses the foreground color
palette to render the embedded object.
Description:
Specifies a URL that contains instructions for downloading the necessary
plug-in for the embedded object if the plug-in is not already installed.
Values:
Either an absolute or relative URL. All URLs should be URL encoded where required.
Description:
This attribute takes precedence over PluginsPage and consists of the
URL of a Java Archive file for use in directly installing a plug-in
if it is not already installed.
Values:
Either an absolute or relative URL. All URLs should be URL encoded where required.
Description:
Defines the measurement system used for absolute integer values of the
HEIGHT/WIDTH and HSPACE/VSPACE attributes.
Values:
'pixels' [Netscape only.
Default value]
'px' [Internet Explorer only.
Default value]
'en' [Netscape only.]
Half the point-size of the current font.
'em' - [Internet Explorer
only.] A scaling factor relative to the size of the current font.
Description:
This attribute specifies the vertical spacing (top and bottom padding)
around the embedded object using the unit system specified in the UNITS
attribute. Values are specified using positive integers.
Values:
Positive integer values. If the UNITS attribute is not specified, the
default measurement system is pixels (px.)
Description:
Specifies the width of the embedded object on the screen.
Values:
Positive integers or a percentage of the screen/window to use. If
the UNITS attribute is not specified, the default measurement system
used for positive integers is pixels (px.)
Example
<embedsrc="audio/realaudioclip.rpm"
align="Bottom" width="40"
height="20"
controls=StopButton
console="SoundClip">
</embed>
<noembed>
Your browser doesn't support plug-ins! Please <ahref="audio/realaudioclip.ram">play
this sound clip</a> using a helper application instead.
</noembed>
[Test]
Although the EMBED element's primary usage now is to include Netscape
plug-ins (support for which began in its 2.0 version), it also has
another use that dates back to version 1.1. It can be used to embed
other documents in an HTML document, like text files, word processor
documents or sound files (sort of like IE's IFRAME element, but without
the dynamic interaction capabilities that IFRAME allows.)
Internet Explorer now supports this element for backward compatibility,
but suggests using the new OBJECT element
(the specification developed by the W3C) instead. Support for OBJECT is
lower right now than for EMBED, but OBJECT will soon be the new
standard for embedding media in HTML documents. Please keep this in
mind when authoring documents.
This element allows a way to expand the capabilities of the browser,
and the attributes given to a plug-in can vary widely. It would be
pointless to list every custom attribute for every Plug-In in
existence. If you need this information, contact the plug-in creators
or go to their web sites.
The embedded object is scaled to fit the area defined by the HEIGHT and
WIDTH attributes.
DTD Note: The Internet Explorer online authoring
guide says that the end tag is not required for EMBED, but other
references list it as being required. I use the stricter model for
the element to be safe.
Browser Peculiarities
Reports exist of early implementations in Netscape that would crash
the program if the URL in the SRC attribute was invalid.
One author reported an example of an embedded element on their web site
expanding to the size of the entire browser window. The problematic
embedded object was given small dimension (1-2 pixels height/width)
and would be accessed using Netscape's own native audio plug-in
that ships with the browser. I verified the behavior on the author's
site in Netscape 3.0 and 4.0, but I have not been able reproduce it with
an example of my own. The strange behavior may possibly be an odd artifact in
a special case, but presumably the plug-in dimensional rendering is done
by the browser and not the plug-in - so, this may NOT be an
isolated case.
Reminder: Netscape uses 'pixels' as a default for
its UNITS attribute while IE uses 'px'.
An extra attribute called BORDER is listed in the Netscape
documentation as being currently supported. In direct testing, this
attribute behaves like the BORDER attribute for the IMG element, and
WAS ONLY SUPPORTED IN NETSCAPE 2.0. Support was dropped in
later versions.
An extra attribute called FRAMEBORDER is listed in the Netscape
documentation as being currently supported (it would supposedly be
used to turn the border surrounding an EMBEDed object on or off.) In
direct testing, it does not appear that this attribute has ever been
supported.
The support histories for the PALETTE, TYPE and UNITS attributes in
Netscape are only semi-educated guesses. Netscape's documentation
does not actually indicate WHEN support began for these
attributes, but it does appear to have been before 4.0.
Plugin support was not added to Mozilla (NS 6.x) until beta 2.
The PLUGINSPAGE was not supported in Netscape 6 betas 1 and 2. Beta
3 resumes support for this attribute.
The source code available on the Mozilla web site seems to indicate
that the EMBED element may support the MAYSCRIPT attribute, but I
haven't been able to verify that yet.