HTML <iframe> Tag
In this tutorial, we will learn about iframe tag in HTML with the help of examples.
<iframe> Tag
Iframe tag <iframe> is used to create an inline frame.
The <iframe> tag is used to embed another document within the HTML document.
Syntax
<iframe>........</iframe>
Example
<!DOCTYPE html>
<html>
<head>
<title>Iframe Tag</title>
</head>
<body>
<iframe src = "www.algbly.com">Algbly</iframe>
</body>
</html>
Output
Specific Attribute
Attribute | Value | Description |
---|---|---|
align | Left right top middle bottom |
It specifies how to align the <iframe> tag according to the surrounding tags |
frameborder | 1 0 |
It specifies whether or not to display border around the frame |
height | pixels percentage |
It specifies the height of the inline frame |
longdesc | URL | URL to long to description of the frame contents |
marginheight | pixels percentage |
It specify the height of the space between the top and bottom of the frame's border and the frame's content |
marginwidth | pixels percentage |
It specify the width of the space between the left and right of the frame's border and the frame's content. |
name | text | It specifies the name of the frame |
sandbox | "" allow-forms allow-same origin allow-scripts allow-top-navigation |
It enables a set of extra restrictions for the content in the iframe |
scrolling | yes no auto |
It determine scrollbar action |
seamless | seamless | It specifies that the iframe should look like it is a part of the containing document |
src | URL | It specifies the location of the frame content file |
srcdoc | HTML_code | It specifies the HTML content of the page to show in the iframe |
width | pixels | It specifies the width of the inline frame |
Global Attribute
Iframe Tag support all the global attributes of HTML.
Event Attribute
Iframe Tag support all the event attributes of HTML.
Next Tutorial
We hope that this tutorial helped you develop better understanding of the concept of iframe tag in HTML.
Keep Learning : )
In the next tutorial, you'll learn about HTML <img>
Tag.