Quackit Logo

HTML 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.

Example
<iframe src="/pix/milford_sound/milford_sound_t.jpg"
  width="200"
  height="150"
  scrolling="auto"
  frameborder="1">
  <!--This bit is only viewed by browsers that don't support inline frames -->
  Your browser doesn't support inline frames.
</iframe>

The above code produces the following inline frame:

Attributes:
Attributes specific to this tag:
AttributeDescription
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:
AttributeDescription
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
  • yes
  • no
frameborderWhether the frame should have a border or not. Possible values:
  • 1 (border)
  • 0 (no 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 (left, center, right, justify).

Also see the complete list of HTML tags


Enjoy this website?

  1. Link to this page (copy/paste into your own website or blog):
  2. Add this page to your favorite social bookmarks sites:
                     
  3. Add this page to your Favorites

Oh, and thank you for supporting Quackit!