<iframe> Tag in HTML

The <iframe> tag in HTML is used to embed another HTML document within the current document. It creates an inline frame that can display external web pages, videos, maps, or other content in a separate window embedded within the page.

Key Points on <iframe> Tag:

Syntax of <iframe> Tag:

Syntax Example

<iframe src="URL" width="500" height="400" frameborder="0"></iframe>

Example of <iframe> Tag in HTML:

This example demonstrates how to use the <iframe> tag to embed a beautiful classical music video into the webpage.

Code Example


        <iframe src="https://www.youtube.com/embed/6wpK47AW98Y" width="500" height="400" frameborder="0"></iframe>
                

Output

The <iframe> tag is widely used for embedding content like videos, maps, and other web resources. It provides a great way to include external resources without navigating away from the current page. However, consider accessibility and security concerns, such as ensuring the content is from a trusted source.