Images & Media
HTML <embed> element
Embeds an external resource handled by the browser or an external handler. Support depends on resource type; prefer native elements for images, audio and video. The example uses illustrative local asset paths; supply matching files before running it. The embedded object is a replaced element with no fallback children. If reliable alternative content is necessary, consider object with fallback or an ordinary link instead. Verify the resource format and browser support. It accepts global HTML attributes; individual global features may be inapplicable or restricted.
Formal Syntax & Structure
html syntaxhtml
<embed src="manual.pdf" type="application/pdf">Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| src | URL | Specifies the resource to load for the given element, such as an image, script or media file. The resource type, loading behavior and security rules depend on the element. Required when no type attribute is supplied; consult the element rules. |
| type | element-dependent keyword or MIME type | Selects an element-specific kind: input control state, button behavior, ordered-list numbering, script interpretation or resource media type. Consult the element's own allowed values. |
| width | non-negative integer | Defines element-specific width, commonly in CSS pixels. On images it can establish an intrinsic aspect ratio together with height; on canvas it sets the bitmap width. |
| height | non-negative integer | Sets an element-specific height, commonly in CSS pixels. On images, pair it with width matching the intrinsic aspect ratio to reserve layout space. It is not a CSS length with units. |
Return Value
HTMLEmbedElement
Content model: Empty; this void element cannot contain children and must not have an end tag. No closing tag.
Working Example
Example Snippethtml
<!doctype html><html lang="en"> <head> <meta charset="utf-8"> <title>HTML example</title> </head> <body> <embed src="manual.pdf" type="application/pdf" width="400" height="300"> <a href="manual.pdf">Open manual</a> </body></html>