Menu
Media & Embedded Content

<iframe> Embeds

Embed another web page (YouTube, maps, sandboxed widgets).

1Safe Embedding

Always set title for accessibility and use sandbox/allow attributes to restrict what embedded content can do.

Example Code
<iframe
  src="https://www.youtube.com/embed/dQw4w9WgXcQ"
  title="YouTube video player"
  width="560"
  height="315"
  loading="lazy"
  allow="accelerometer; autoplay; clipboard-write; encrypted-media"
  allowfullscreen
></iframe>

Finished reading?

Mark this topic as complete to track progress.