Skip to main content
Albero Academy

Iframes & Embeds

Embed other pages and content — safely.

Media & Embeds7 min

An <iframe> ("inline frame") embeds another web page inside yours — a YouTube video, a map, a payment widget. It's powerful but needs care around security.

Using an iframe

an embedded video
<iframe
src="https://www.youtube.com/embed/VIDEO_ID"
title="Descriptive title"
width="560" height="315"
loading="lazy"
allowfullscreen
sandbox="allow-scripts allow-same-origin">
</iframe>

Key takeaways

  1. 01An <iframe> embeds another web page (video, map, widget) inside yours.
  2. 02Only embed trusted sources — an iframe runs external content.
  3. 03Use the sandbox attribute to restrict what embedded content can do.
  4. 04Always add a title for accessibility and loading="lazy" for performance.

Finished this chapter?

Mark it complete to track your progress through HTML.