IFRAME HTML EXAMPLE

Share the post

Hello All, We will discuss the iframe in this topic. I will explain to you what is an iframe? How to use iframe? Will discuss the complete topic of the iframe HTML example.

What is an iframe?

the iframe is used to display a web page within our HTML page. Suppose you have one HTML page & you want to integrate another HTML page within the existing HTML page then in that case we will use an iframe.

How to use iframe?

If you want to use iframe within your HTML page then you should use <iframe></iframe> tag. Within this tag, You have mentioned the src property to specify the HTML address which you want to include in this HTML. You can also specify the width & height of HTML by adding width & height properties within the iframe tag. For more clarification, We can also add the title property.  

Please find below IFRAME HTML Example :

iframe example is shown as follows :

index.html

<html>


<head>
    <h1>HTML : iframe example</h1>
    <style>


    </style>
</head>


<body>


    <h1>iframe example</h1>
    <iframe src="iframe_index.html" title="This is iframe" height="500px" width="500px;"></iframe>




</body>


</html>


<script>


</script>

iframe_index.html

<html>


<head>


    <style>


    </style>
</head>


<body>


    <h1>This is HTML within iframe</h1>


</body>


</html>


<script>


</script>

Note: Make sure that index.html & iframe_index.html files should exist in the same folder.

OUTPUT

iframe_output
Output

Leave a Comment