1. What is an Iframe?
An Inline Frame () is used to embed another HTML document or external interactive widget (such as a YouTube video, Google Maps location, or PDF viewer) within the current web page.
2. Embedding Video and Map Widgets
3. Iframe Security: The sandbox Attribute
Embedding external third-party content poses security hazards (XSS, unauthorized redirects). The sandbox attribute imposes strict security restrictions:
4. Performance Tip: loading="lazy" on Iframes
Similar to images, adding loading="lazy" to an iframe defers loading of heavy embedded widgets until the user scrolls them into the active viewport.