Monday, August 30, 2010

The <embed> and <noembed> Elements

The embed element is a non-standard element that is used to embed multimedia content into a webpage. Often, the multimedia content will require browser plugins like Flash Player, QuickTime Player etc.

The embed element is not part of any current (X)HTML standard except the unfinalized HTML 5. The recommended element for embedding media objects is the object element, which is part of the HTML 4.01 and XHTML 1.0 Standard.

The embed element can have a block or inline parent element.

Attributes

align
This attribute can take the values left, right, top and bottom. However, it is perferable to use CSS instead of this attribute.
height and width
Specifies the height and width of the element. It is perferable to use CSS instead of these attributes.
name and id
These attributes specify a name for the embedded object. However, it is better to use only the id attribute because name is deprecated in XHTML.
hidden
This attribute can take the values yes or no. A value of yes hides the object. This is not a well supported attribute and must therefore be avoided.
pluginspage
The value of this attribute is a URL of a page that contains instructions on how to download and install the plugin required to render the embedded content. This attribute is obsolete.
hspace and vspace
These attributes were used to specify the amount of horizontal and vertical space that should be left clear of the embedded object. It is preferable to use CSS instead of these attributes.
src
The value of this attribute is the URL of the file or object to be embedded.
type
The value of this attribute is the MIME type of the embedded object. However, the browser can also determine the type of object by the file extension of the file specified by src or by the header sent by the server when the object is accessed.

HTML 5 allows any other attributes that are specific to the kind of object embedded.

The noembed Element

This is a nonstandard child element of the embed element. It contains text, images or objects that are displayed when the embedded object cannot be displayed.

No comments: