Example

Iframes in HTML

HTML

<!DOCTYPE html>
<html lang="en-us">
    <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>Iframes in HTML</title>
    </head>
    <body>
<!--
    <iframe> : represents a nested browsing context, embedding another HTML page into the current one.
    Each embedded browsing context has its own session history & document.    
-->

    <h1>Demo: Iframes in HTML </h1> 

    <!-- An iframe containing a openstreep Map -->   
    <iframe id="inlineFrameExamplemap"
            title="Inline Frame Example Map"
            width="50%"
            height=auto
            src="https://www.openstreetmap.org/export/embed.html?bbox=-0.004017949104309083%2C51.47612752641776%2C0.00030577182769775396%2C51.478569861898606&layer=mapnik">
    </iframe> <hr><br>

    <!-- An iframe containing a HTML file -->   
    <iframe id="inlineFrameExamplehtml"
            title="Inline Frame Example HTML"
            width="60%"
            height="300"
            src="/notes/examples/html/output/003.html"> 
    </iframe> <hr><br>

    <!-- An iframe containing a .jpg image file -->   
        <iframe id="inlineFrameExamplepng"
            title="Inline Frame Example PNG"
            width='50%'
            height= auto
            src="/notes/examples/assets/img/football.jpg"> 
    </iframe> <hr><br>  

    <!-- An iframe containing an external website homepage -->   
    <iframe id="inlineFrameExamplehtml"
            title="Inline Frame Example HTML"
            width="66%"
            height="500"
            src="https://thehindu.com/index.html"> 
    </iframe> <hr><br>

    </body>
</html>

</body>
</html>
                    
                    

Output

View original