SimpleTuts.com

HTML Iframes

An iframe (inline frame) is an HTML element that allows you to embed another HTML document within the current document. It is commonly used to display content from other websites, such as videos, maps, or any other webpage.

Basic Syntax

The basic syntax for creating an iframe is:


    <iframe src="URL" width="600" height="400"></iframe>
    

Attributes

Example


<html>
<head>
    <title>Iframes</title>
</head>
<body>

    <h1>Iframe Example</h1>
    
    <a href="list.html" target="myframe">lists</a>
    <a href="tables.html" target="myframe">tables</a>
    <br><br>
    
    <iframe src="tables.html" name="myframe" frameborder="1" 
        width="700" height="350">
    </iframe>
    
</body>
</html>
Run Code