HTML <iframe> Tag
Description
The <iframe> tag in HTML stands for inline frame. It is used to embed another HTML document within the current document, essentially creating a window or frame that displays external content. Unlike links, which navigate the user to a different page, an <iframe> allows content from another source to appear directly on the page without leaving the current context.
This makes <iframe> useful for a wide range of scenarios, such as embedding videos, maps, advertisements, interactive widgets, or even entire websites. The embedded content operates independently from the parent document, meaning it has its own browsing context and can have its own HTML structure, styles, and scripts.
One key characteristic of <iframe> is that they are self-contained. The content inside the frame does not automatically inherit the styles or scripts of the parent page, although it can communicate with the parent document using JavaScript if allowed by security policies. This separation is crucial for security, especially when embedding content from third-party sources.
Additionally, <iframe> can vary in size and appearance. By default, they display a rectangular window within the page, but designers can adjust the height, width, and styling to integrate the frame seamlessly into the layout. Despite their flexibility, <iframe> should be used thoughtfully because excessive use can affect page performance, load times, and accessibility if not properly handled.
Properties
- Permitted Parents
- Any element that accepts embedded content
- Content
- Any block, inline and text
- Start/End Tags
- Start tag: required, End tag: required
Example
Attributes
Global Attributes
The <iframe> tag also supports the Global Attributes in HTML5
Event Attributes
The <iframe> tag also supports the Event Attributes in HTML5
Browser Support
The following information will show you the current browser support for the HTML <iframe> tag. Hover over a browser icon to see the version that first introduced support for this HTML tag.
This tag is supported by all modern browsers.
Desktop
Tablets & Mobile
Last updated by CSSPortal on: 26th December 2025
