The <iframe> tag can appear anywhere in your document. The <iframe> tag defines a rectangular region within the document in which the browser can display a separate document or file. HTML iframe attributes are:
Attribute | Description |
---|---|
align | Specifies the iframe alignment. Value can be left, right, top, bottom, middle. Default is left. Note: align attribute is not supported in HTML5. |
src | Specifies the source of the file to be appeard in the iframe. |
Frameborder | Specifies whether border should be displayed around iframes or not. This attribute takes value either 1 (yes) or 0 (no). Default value is 1. |
height width | Specifies the height and width of the iframe file. |
HTML iframe: Syntax
<iframe src="file.html" width="555px" height="200px"> </iframe>
Example 1: Include external html file in your document using iframe tag.