Skip to: content, navigation

by Ian Lloyd

embed (HTML element)

Spec
Depr. Empty Version
Yes Yes N/A
Browser support full matrix
IE5.5+ FF1+ Saf1.3+ Op9.2+
Partial Partial Partial Partial

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>
Type
inline element
Contains
nothing
Contained by
block-level elements, inline elements (except pre)

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.

Use This for…

This element is used for media files (primarily movie files, such as Flash and QuickTime video).

Compatibility

IE5.5Partial
6.0Partial
7.0Partial
Firefox1.0Partial
1.5Partial
2.0Partial
Safari1.3Partial
2.0Partial
3.0Partial
Opera9.2Partial
9.5Partial

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

Related Reading

User-contributed notes

ID:
#1
Date:
Wed, 12 Mar 2008 20:09:09 GMT
Contributed by:
itpastorn

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.

Related Products

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters