Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / HTML

embed — embedding an external resource

The `embed` element provides an integration point for an external application or interactive content. It identifies a resource through `src`; handling depends on the browser and content type.

Version: WHATWG HTML Living Standard; index snapshot date recorded separately

Syntax

<embed src="resource-url" type="mime-type" width="320" height="180">

embed embeds a resource handled by the browser or an external application. The src attribute, when present, must contain a valid, non-empty URL. The example's data: URL stores the entire resource without a separate file.

The optional type specifies a MIME type. When both src and type are present, the type must match the resource's explicit Content-Type metadata. width and height specify dimensions; the example uses 120 × 60 CSS pixels.

In HTML syntax, embed is a void element: it has no end tag or child content. It provides no fallback content. If you need fallback content inside the element, consider object; a separate link beside embed can provide alternative access.

Specifying type alone does not guarantee format support. The example should display a blue rectangle if embedded SVG is supported and permitted. Do not treat embed as an isolation mechanism for untrusted content.

Examples

<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>embed demo</title>
<embed
  src="data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='120'%20height='60'%3E%3Crect%20width='120'%20height='60'%20fill='blue'/%3E%3C/svg%3E"
  type="image/svg+xml"
  width="120"
  height="60"
  title="Blue rectangle">
</html>

Result

A blue rectangle, 120 CSS pixels wide and 60 CSS pixels high, if embedded SVG is supported and permitted.

The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.

Sources