What is an iframe?

An iframe is a window in your page onto another document. The outer page decides the size of the box; the inner page draws itself inside it and cannot reach anything outside. That separation is the whole point, and the whole difficulty.

What is an iframe? It is the HTML element that puts one document inside another: a box on your page, and a second page drawn inside the box. The two stay separate.

The markup. The highlighted line is the part this term is about.
The markup. The highlighted line is the part this term is about.

The inner page cannot read your cookies or change your layout, and you cannot easily make the box grow to fit what is inside. Every embed you have seen, a map, a video, a form from another service, is an iframe.

This guide covers what the separation means, the height problem, the attributes worth setting, how to stop others framing your page, and when a link is better than a frame.

An iframe is a window in your page showing a different page.

<iframe src="https://example.com/report" title="Quarterly report"></iframe>

Two complete documents now exist. Each has its own address, its own styles, its own scripts, and its own idea of what "the page" is.

Host document iframe a second page inside the first it cannot reach anything outside this box
The outer document holds a frame; inside it, a second complete page.

What an iframe's separation means

The browser keeps the two apart unless they share an origin — the same scheme, host and port.

An <iframe> is a window onto another document. The outer page decides the box; the inner page draws itself inside it and cannot read anything outside.
An