Skip to the page
html reference · links & media

HTML <iframe> tag

closing tag
required
void element
no
lives inside
anywhere in <body>
typically holds
nothing — src loads a whole separate document

Where it goes

Anywhere in <body>. It needs a src pointing at the page to show, and a width and height so it is not a tiny sliver.

Example

<iframe src="https://example.com/map" title="Location map"></iframe>

Open this example in the editor →

Common mistakes

  • Leaving off title. Without it, a screen reader (software that reads the page aloud) cannot say what the embedded page is.
  • Expecting to style or read what is inside it with your own CSS or JavaScript. If the page comes from another site, the browser blocks that on purpose.

Related

Updated 24 October 2026. Practice it in the html route, or read more on MDN.