HTML 4 iframe Tag

Also see HTML5 <iframe> Tag.

This page contains information about the HTML 4 version of this element. For a more up to date version, see HTML5 <iframe> Tag.

The HTML iframe tag is used to specify an inline frame.

An inline frame allows you to embed another document within the current HTML document. You use the iframe src attribute to specify the source of the other document, as well as other attributes to determine the height, width, scrolling properties, border etc.


The above code produces the following inline frame:


Attributes specific to this tag:
nameAssigns a name to a frame. This is useful for loading contents into one frame from another.
longdescA long description - this can elaborate on a shorter description specified with the title attribute.
widthSpecifies the width of the inline frame.
heightSpecifies the height of the inline frame.
Other Attributes:
classDocument wide identifier.
idDocument wide identifier
titleSpecifies a title to associate with the element. Many browsers will display this when the cursor hovers over the element (similar to a "tool tip").
styleInline style (CSS)
srcLocation of the frame contents (for example, the HTML page to be loaded into the frame).
scrollingWhether the frame should be scrollable or not (i.e. should scrollbars appear). Possible values:
  • auto: This value means that scrollbars should appear on the frame, only if the contents of the framed page are too big to fit inside the frame
  • yes: Scrollbars should always appear on the frame, regardless of the size of its contents
  • no: Scrollbars should not appear, even if the contents are too big for the frame
frameborderWhether the frame should have a border or not. Possible values:
  • 1: The frame should have a border
  • 0: The frame should not have a border
marginwidthSpecifies the margin, in pixels, between the frame's contents and it's left and right margins.
marginheightSpecifies the margin, in pixels, between the frame's contents and it's top and bottom margins.
alignFor alignment. Possible values:
  • left: Text is rendered flush left
  • center: Text is centered
  • right: Text is rendered flush right
  • justify: Text is justified to both margins

HTML5 Tags

The information on this page is based on HTML version 4.01. Most modern browsers now support HTML5, which is the next version of HTML after HTML 4.01.

See HTML5 <iframe> Tag for the HTML5 version of the above element.

Also see this list of HTML 5 tags for the latest version of HTML.