Ad

HTML Iframe Tag

The <iframe> tag can appear anywhere in your document. The <iframe> tag creates a rectangular region within the document in which you can display a separate document or file.

HTML Frame tag attributes:
AttributeDescription
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.
align* Specifies the iframe alignment. Value can be left, right, top, bottom, middle. Default is left.

HTML iframe: Syntax

<iframe src="file.html" width="555px" height="200px"> </iframe>

Example 1: Include external html file in your document using iframe tag.

Using iframe tag, you can embed:

  1. pdf file
  2. Google Map
  3. YouTube Video
  4. Weather Widget & many more

Ad: