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
- src: Specifies the URL of the page to embed.
- width: Sets the width of the iframe.
- height: Sets the height of the iframe.
- frameborder: Controls the visibility of the border around the iframe (deprecated in HTML5).
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