Skip to content

<embed> - External Application Element

Embedded Content HTML 5.0

The embed element embeds external content at the specified point in the document. Historically used for browser plugins like Flash, it’s now primarily used for embedding PDFs and SVG files, though modern alternatives are often preferred.

Result
<embed src="file.pdf" type="application/pdf">

The <embed> element is a void element (self-closing) and does not have a closing tag or child content.

AttributeDescriptionExample
srcURL of the external resourcesrc="document.pdf"
typeMIME type of the embedded contenttype="application/pdf"
widthWidth in pixelswidth="600"
heightHeight in pixelsheight="400"
titleAccessible description (recommended)title="Annual Report PDF"

The <embed> element accepts any attributes, which are passed to the plugin or application handling the content:

<!-- PDF with custom parameters -->
<embed
src="document.pdf"
type="application/pdf"
toolbar="0"
navpanes="0"
scrollbar="0">
<!-- Flash (legacy example) -->
<embed
src="animation.swf"
type="application/x-shockwave-flash"
quality="high"
wmode="transparent">
Result

PDF URL Parameters:

  • #page=3 - Open to specific page
  • #zoom=150 - Set zoom level (percentage)
  • #toolbar=0 - Hide toolbar
  • #navpanes=0 - Hide navigation panes
  • #scrollbar=0 - Hide scrollbar
  • #view=FitH - Fit width
  • #pagemode=bookmarks - Show bookmarks
<embed
src="document.pdf"
type="application/pdf"
width="600"
height="400">
Result
Result
<!-- Legacy QuickTime embed -->
<embed
src="movie.mov"
type="video/quicktime"
width="640"
height="480"
controller="true"
autoplay="false"
pluginspage="http://www.apple.com/quicktime/download/">
Content TypeLegacy (<embed>)Modern Alternative
PDF<embed src="file.pdf"><iframe src="file.pdf"> or <object>
SVG<embed src="file.svg"><img src="file.svg"> or inline SVG
Video<embed src="video.mp4"><video><source src="video.mp4"></video>
Audio<embed src="audio.mp3"><audio><source src="audio.mp3"></audio>
Flash<embed src="file.swf">Use HTML5/JavaScript/CSS instead
Images<embed src="image.jpg"><img src="image.jpg">
External HTML<embed src="page.html"><iframe src="page.html">

Rare Cases Only: Legacy system compatibility, specific plugin requirements, quick PDF embedding (though <iframe> is better).

Limitations: No fallback content, poor accessibility, browser-dependent behavior, no standardized attributes.

Since <embed> doesn’t support fallback content, provide alternatives nearby:

Result
<embed
src="presentation.pdf"
type="application/pdf"
width="800"
height="600"
title="Q4 Sales Presentation - Annual Review">
<embed
src="chart.svg"
type="image/svg+xml"
width="600"
height="400"
title="Revenue Growth Chart 2024"
aria-label="Bar chart showing 15% revenue growth">
Result
Result
Result
Result
Result
Result
Result

Security Best Practices:

  1. Never use Flash or other deprecated plugins
  2. Prefer native HTML5 elements (<video>, <audio>, <img>)
  3. Use <iframe> with sandbox for external content
  4. Validate file types on the server side
  5. Implement Content Security Policy to restrict embed sources
Result

Always specify the correct MIME type to prevent content type confusion attacks:

<embed
src="document.pdf"
type="application/pdf"
width="600"
height="400">
<embed
src="image.svg"
type="image/svg+xml"
width="200"
height="100">
FeatureChromeFirefoxSafariEdge
<embed> element1+1+1+12+
PDF embedding1+19+5+12+
SVG embedding4+4+5+12+
Flash plugin❌ Removed 88+❌ Removed 85+❌ Removed 14+❌ Removed 88+
Java plugin❌ Removed 45+❌ Removed 52+❌ Removed 12+❌ Removed
QuickTime plugin❌ Deprecated❌ Deprecated❌ Deprecated❌ Deprecated
MIME TypeDescriptionModern Alternative
application/pdfPDF documentsUse <iframe> or <object>
image/svg+xmlSVG vector imagesUse <img> or inline SVG
application/x-shockwave-flashFlash (deprecated)Use HTML5/CSS/JavaScript
video/mp4MP4 videoUse <video> element
audio/mpegMP3 audioUse <audio> element
video/quicktimeQuickTime (deprecated)Use <video> with MP4
application/x-java-appletJava (removed)Use modern web technologies
<embed
src="animation.swf"
type="application/x-shockwave-flash"
width="800"
height="600"
quality="high"
wmode="transparent">
<embed
src="document.pdf"
type="application/pdf"
width="600"
height="400">
<!-- No fallback possible -->