embed (HTML element)
| Depr. | Empty | Version |
|---|---|---|
| Yes | Yes | N/A |
| IE5.5+ | FF1+ | SA1.3+ | OP9.2+ |
|---|---|---|---|
| Partial | Partial | Partial | Partial |
Syntax
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 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).
Compatibility
| Internet Explorer | Firefox | Safari | Opera | |||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 5.5 | 6.0 | 7.0 | 1.0 | 1.5 | 2.0 | 1.3 | 2.0 | 3.0 | 9.2 | 9.5 |
| Partial | Partial | Partial | Partial | Partial | Partial | Partial | Partial | Partial | Partial | Partial |
This element is very
well supported in current browsers, and has been supported in Netscape
Navigator and Internet Explorer as far back as versions 2 and 3,
respectively. Therefore, it has a longer heritage than the relative
newcomer, the object element, and refuses to disappear.
The fact that video-sharing web sites like You Tube offer
embed markup as a mechanism for users to share and
embed videos into web pages means that this high level of support is
highly unlikely to wane in the immediate
future.
In this Section
align
alignment/position of theembedcontent relative to surrounding contentalt
alternative text forembedcontentborder
sets border thickness around theembedcontentheight
sets theembedcontent’s heighthidden
Sets the embed content to be invisiblehspace
sets amount of space horizontally (either side) for the embedded contentname
name for referencing theembedelement bypluginspage
defines the location for required plug-intype
defines the MIME type for theembedcontentvspace
sets amount of space vertically (top and bottom) for the object
User-contributed notes
- ID:
- #1
- Date:
- Wed, 12 Mar 2008 20:09:09 GMT
It might also be worth mentioning that this element very probably will be part of (X)HTML 5.
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.