HTML Iframes - Detailed Overview

Introduction to HTML Iframes

An iframe (short for inline frame) is an HTML element that allows you to embed another HTML page within the current page. Iframes are commonly used to embed videos, maps, or other external content.

Basic Iframe Example

To create an iframe, use the <iframe> tag and specify the src attribute with the URL of the page you want to embed. For example:

<iframe src="https://www.shariqsp.com"></iframe>

Customizing Iframes

You can customize the appearance of an iframe using attributes like width, height, and border. For example:

<iframe src="https://www.shariqsp.com" width="600" height="400" style="border:2px solid #ccc;"></iframe>

Iframe with No Borders

To remove the border around an iframe, you can set the frameborder attribute to "0" or use CSS styling. For example:

<iframe src="https://www.shariqsp.com" frameborder="0" style="border:none;"></iframe>

Iframe Attributes

There are several other useful attributes for iframes:

For example:

<iframe src="https://www.shariqsp.com" allowfullscreen name="myIframe" sandbox="allow-scripts" loading="lazy"></iframe>