0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…
The embed element is a void element for embedding external content. It provides no fallback mechanism -- prefer modern alternatives like iframe, video, and audio.
Description
The <embed> element provides an integration point for external content or applications, typically handled by browser plugins. It is a void element (self-closing) with no closing tag and no fallback content mechanism.
Originally designed for plugin content like Flash and Java applets, <embed> has limited utility in modern web development. Unlike <object>, it cannot contain fallback markup, so if the resource fails to load the user sees nothing.
When to Use
In modern HTML, there is almost always a better alternative. The <embed> element should only be used when no other element supports the content type and you are certain the resource will load.
Prefer Modern Alternatives
Use <iframe> for embedding HTML documents and web applications
Use <video> for video content with native controls and captions
Use <audio> for audio content with native controls
Inline PDF rendering is a desktop-browser feature. Most mobile browsers do not render a PDF inside <embed>, and because <embed> has no fallback, those users see an empty box. For PDFs, prefer <object> with a download link inside it, and consider a visible download link next to the embed as well. Exact behaviour varies by browser and settings (some desktop users disable the built-in viewer), so test on your target devices.
Plugin-based content (Flash, Java, Silverlight) is no longer supported by modern browsers. This syntax is shown for historical reference only.
embed vs. object
The key difference is fallback content. <embed> is a void element with no closing tag, so it cannot contain alternative markup. <object> supports content between its tags that is displayed when the resource fails to load.
Comparison: embed, object, and img
12345678910
<!-- embed: no fallback if the resource fails --><embedsrc="chart.svg"type="image/svg+xml"width="400"height="300"><!-- object: fallback content is displayed on failure --><objectdata="chart.svg"type="image/svg+xml"width="400"height="300"><p>Chart unavailable. <ahref="chart.png">View as image</a>.</p></object><!-- Best: use native elements --><imgsrc="chart.svg"alt="Quarterly revenue chart"width="400"height="300">
For any use case where the resource might not load, prefer <object> or a native element over <embed>.
Sizing
VB styles <embed> and <object> as display: block with max-inline-size: 100%. On their own that clamps the width but not the height, because these elements have no natural aspect ratio — in a narrow container a 600×400 embed becomes a tall, letterboxed box. Two primitives fix that without inline styles:
data-ratio on the element — the block size follows the used width. A widthattribute stays the preferred (maximum) width; without one the element fills its container. Values: 1:1, 4:3, 3:2, 16:9 (default), 21:9, 2:3, 3:4, 9:16, and page (1 : 1.414, a portrait document page). Also works on <iframe>.
data-media wrapper — a ratio box (data-ratio, data-radius) whose child <embed>, <object> or <iframe> fills it. The legacy .embed-responsive class works the same way. If the wrapper is a <figure> with a <figcaption>, the ratio applies to the media child and the caption flows below it (see figure).
Responsive embed sizing
123456789
<!-- Ratio on the element: 600px wide at most, height follows --><embedsrc="diagram.svg"type="image/svg+xml"width="600"height="400"data-ratio="3:2"title="Network diagram: three servers behind a load balancer"><!-- Ratio box wrapper: the embed fills it --><figuredata-mediadata-ratio="16:9"><embedsrc="slides.svg"type="image/svg+xml"title="Launch slides, slide 1"></figure>
When printing, VB keeps <embed> and <object> from splitting across pages and caps them at the page width.
Security
<embed> (like <object>) has no sandboxattribute. Embedded SVG and HTML documents run their scripts with the embedded document's origin, and same-origin content can reach into your page.
For untrusted or user-supplied SVG, use <img> — SVG loaded as an image never runs script.
For untrusted HTML, use <iframe sandbox>, which can strip script, forms and same-origin access.
The typeattribute is only a hint. The server's Content-Type header decides how the resource is handled, so type="image/svg+xml" does not stop an HTML response from being rendered as HTML.
If you don't use these elements, turn them off with Content Security Policy: object-src 'none' blocks both <object> and <embed>.
The <embed> element has significant accessibility limitations:
No fallback content mechanism -- if the resource cannot be loaded, the user gets nothing
No native altattribute like <img> — give every embed an accessible name with title or aria-label that describes the content (“2026 annual report (PDF)”), not the element (“Embedded content”)
Embedded content is opaque to screen readers unless the content itself is accessible
Prefer elements with built-in accessibility semantics (<img>, <video>, <audio>) whenever possible
Related
<object> - Similar embedding with fallback content support
<iframe> - For embedding HTML documents with security sandboxing
<video> - For video with native controls, captions, and multiple sources
<audio> - For audio with native controls and multiple sources