HTML IFrame Tag is an abbreviation of In-Line Frames which is used to embed one HTML document inside another HTML document. It is generally used to overcome the disadvantages of using Frames. It is also used for displaying advertising content or for the purpose of comparing two or multiple HTML documents.
Web programmers can change frame contents through IFrame using client side scripting language like JavaScript without requiring the website to be reloaded.You can even embed a video on your site and that other webpage of video will not appear as a full webpage but will look like it is a part of your page.
This will produce following result
The below table contains HTML IFrame Attributes and their description which is supported by HTML version.
Attribute Name | Attribute Value | Attribute Description |
---|---|---|
src | URL | refers to the url of the document to be loaded into the iframe |
height | pixels | refers to the height of an iframe |
width | pixels | refers to the width of an iframe |
align | top,middle,bottom,left,right | refers to the the alignment of an iframe with respect to surrounding elements |
marginheight | pixels | refers to space to be left at the top and bottom sides of the iframe |
marginwidth | pixels | refers to space to be left along the sides of the iframe |
name | text | refers to a name for the iframe |
scrolling | pixels | refers to to decide whether to have scrollbarsin a iframe |
longdesc | URL | refers to URL to the document containing long description of the iframe |
frameborder | pixels | refers to whether borders of the iframe are shown |