HTML iframes

Last Updated : 27 May, 2026

An iframe, or Inline Frame, is an HTML element represented by the

    The src attribute specifies the URL of the document you want to embed, and iframes can include videos, maps, or entire web pages from other sources.

    HTML iframes Examples

    HTML iframes are used to embed external web pages, videos, or documents inside a webpage without reloading the main page.

    Example 1: Basic iframe Embedding

    In this example, an iframe is used to display another webpage within the current webpage.

    HTML
    
    <html>
    <head>
        <title>title>
    head>
    <body style="text-align: center">
        <h2>HTML iframe Tagh2>
        <iframe src="https://media.geeksforgeeks.org/wp-content/uploads/20240206111438/uni2.html"
                height="370"
                width="400">
        iframe>
    body>
    html>
    

    Output:

    • src: Specifies the URL of the page to display within the iframe.
    • width and height: Defines the size of the iframe on your page.

    Supported Attributes of the