<embed>

HTML4 HTML5

Embeds external resources, such as media files (e.g., PDF, audio/video) or interactive applications.

Void (self-closing) element – does not have a closing tag.

Attributes:

src="..." - (Required) Path to embedded file or resource.

type="..." - MIME type of embedded resource (e.g., application/pdf, image/svg+xml).

width="..." - Width of embedded area (in pixels or percentage).

height="..." - Height of embedded area (in pixels or percentage).

Example

Code:

<embed src="data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='150' height='100'><rect width='100%' height='100%' fill='%23007bff'/><text x='50%' y='50%' fill='white' dominant-baseline='middle' text-anchor='middle' font-family='sans-serif' font-size='14'>SVG Image</text></svg>" type="image/svg+xml" width="150" height="100" style="border: 1px solid #ccc;">

The browser will interpret this code as follows: