iframe
The iframe element loads a second web page inside a box on the current page. The page in the frame keeps its own URL, scripts, and cookies.
HTML element
Also called Inline frame
Updated
On this page
Example
HTML
<iframe src="https://widget.example/booking" title="Booking form" width="600" height="400" ></iframe>
Without width and height, the frame is 300 by 150 CSS pixels.
How to use it
Set the URL in src and a short title for screen readers. Add loading="lazy" for a frame far down the page.
<iframe src="https://widget.example/booking" title="Booking form" width="600" height="400" loading="lazy" ></iframe>
The framed site decides if it can load in a frame. No iframe attribute can override its frame-ancestors or X-Frame-Options header.
Learn more
Sources