HTML <embed>
Published Jul 1, 2022
Contribute to Docs
The <embed> element renders an element that wraps around interactive content, including images, videos, and even other web pages. This is achieved with tools such as browser plug-ins. However, since most modern browsers no longer support plug-ins, there are other tags to use instead of <embed>. This includes:
- Playing video content with the
<video>element. - Displaying images with the
<img>element. - Rendering additional markup with the
<iframe>element.
Since those tags are available, using the <embed> element is discouraged.
Syntax
<embed type="" src="" width="" height="" />
The <embed>element is self-closing and accepts at least four properties:
- The
typeof content to be embedded (e.g. “image/jpg”). - The
srcof the content. - The content’s
height, measured in pixels. - The content’s
width, measured in pixels.
Example
The following example showcases the <embed> element:
<!DOCTYPE html><html><head><title>Learning about HTML</title></head><body><embed type="image/jpg" src="my_image.jpg" width="300" height="200" /></body></html>
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn HTML on Codecademy
- Front-end engineers work closely with designers to make websites beautiful, functional, and fast.
- Includes 34 Courses
- With Professional Certification
- Beginner Friendly.115 hours
- Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.
- Beginner Friendly.7 hours