HTML iFrames


HTML Iframes

HTML iframes (inline frames) are used to embed another HTML document within the current web page. They are like windows where web pages can be displayed. Iframes are commonly used to include external content, such as videos, maps, advertisements, or other web pages, within a primary HTML document.
Here’s an overview of HTML iframes:
Creating an Iframe:
To create an iframe in HTML, you use the <iframe> element. It’s a self-closing tag, and you specify the source URL of the content you want to embed using the src attribute.
<iframe src=””></iframe>
In this example, an iframe is created with the source URL “”
Attributes of the <iframe> Element:
– src: Specifies the source URL of the content to be embedded.
– width and height: Determine the dimensions (width and height) of the iframe.
– frameborder: Indicates whether or not to display a border around the iframe.
– allowfullscreen: Allows the iframe content to enter fullscreen mode.
– sandbox: Provides a security sandbox for the iframe’s content.
Example of an Embedded Google Map:
Here’s an example of embedding a Google Map using an iframe:

In this example, an iframe embeds a Google Map with specified dimensions, a border set to 0, and allows fullscreen enabled.
Note: Always consider the source and security implications when embedding content from external websites using iframes. Make sure you have the necessary permissions to display external content within your web page.
HTML iframes are a versatile way to integrate external content seamlessly into your web pages, enhancing the user experience and providing access to a wide range of resources and services.