What is an iframe in HTML and what is it used for?

An iframe (inline frame) shows another web page inside your page. It is used to embed YouTube videos, Google Maps, payment forms and widgets.

<iframe src="https://www.example.com" width="600" height="400" title="Example"></iframe>
  • Always give a title, width and height.
  • Some sites block embedding, and then the frame stays blank.
  • Use sandbox and loading="lazy" for safety and speed.

See HTML Iframes.


Learn more about the similar topics:
Tutorials
No Content Found.
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.