Open In App

How to create an inline frame using HTML5 ?

Last Updated : 05 May, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

In this article, we will create an inline iframe by using a

<iframe> tag

in a document. It represents a fixed rectangular area within the document in which the browser can display a separate document along with scroll bars and borders. Inline frames are used to embed another document within the current HTML page.

Syntax :

<iframe src="URL"></iframe>

Example:

html
<!DOCTYPE html>
<html>

<head>
    <title>
        How to create an inline 
        frame using HTML5?
    </title>
</head>

<body>
    <h2>Hlo GeeksForGeeks</h2>

    <h2>
        How to create an inline 
        frame using HTML5?
    </h2>

    <p>Content goes here</p>

    <iframe src=
"https://www.geeksforgeeks.org/community/" 
        height="300" width="400">
    </iframe>

</body>

</html> 


Example 2:

html
<!DOCTYPE html>
<html>

<head>
    <title>
        How to create an inline 
        frame using HTML5?
    </title>
</head>

<body>
    <h2>Hlo GeeksForGeeks</h2>

    <h2>
        How to create an inline 
        frame using HTML5?
    </h2>

    <iframe height="300" width="350"
        src="
https://media.geeksforgeeks.org/wp-content/cdn-uploads/20190717121605/Screenshot-from-2019-07-17-12-12-55.png"
        name="iframe_a"></iframe>

</body>

</html>


Supported Browser are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

Next Article
Article Tags :

Similar Reads