embed (HTML element)
Description
embed
is a non-standard but well-supported element that’s used to embed multimedia content, including media types that mightn’t usually be natively supported by the browser. It can also be used for embedding media types that are supported, such as images in .jpg, .gif, or .png format.
embed
isn’t part of any currently recognized standard, so if you use it, your page can’t possibly validate; to create valid markup, you’ll need to use the object element, which was defined in HTML 4. That said, using embed
is widely recognised as a good way to embed Flash in an accessible manner, and many believe that it’s acceptable to compromise validity for the sake of accessibility.
embed
won’t work for formats that are natively supported in the browser, such as HTML and images — use the built-in, properly supported mechanisms for such formats. The formats that embed
supports are generally restricted to those that would require an additional plugin in order to work.
Although embed
is an empty element, an end tag is still required for the sake of browser compatibility.
Example
In this example, a super-simple embed
element is used to display a video file in .mp4 format:
<embed src="volksworld-video-report.mp4"> </embed>
Use This for…
This element is used for media files (primarily movie files, such as Flash and QuickTime video).
In this Section
- align
alignment/position of the embed content relative to surrounding content - alt
alternative text for embed content - border
sets border thickness around the embed content - height
sets the embed content’s height - hidden
Sets the embed content to be invisible - hspace
sets amount of space horizontally (either side) for the embedded content - name
name for referencing the embed element by - pluginspage
defines the location for required plug-in - type
defines the MIME type for the embed content - vspace
sets amount of space vertically (top and bottom) for the object