iframe

FilterElements

<iframe> ... </iframe>

Defines an inline (floating) frame that is used for embedding an HTML document in a separate browsing context (window) within the parent document. An inline frame displays the content of an external document and may display scrolling devices if the content doesn’t fit in the specified window area. Inline frames may be positioned similarly to images. The content of the iframe element (between the start and end tags) displays in browsers that do not support inline frames.

Start/End Tags

Required/Required

Specifications

  • HTML 4.01
  • HTML5

align=

Values: top | middle | bottom | left | right
Deprecated. Not in HTML5. Aligns the inline frame on the page within the flow of the text. Left and right alignment allows text to flow around the inline frame.

frameborder=

Values: 1 | 0
Not in HTML5. Turns on or off the display of a 3D border for the inline frame. The default is 1, which displays the border.

height=

Values: number
Specifies the height of the inline frame in pixels or as a percentage of the window size.

longdesc=

Values: URL
Not in HTML5. Specifies a link to a document containing a long description of the inline frame and its contents.

marginheight=

Values: number
Not in HTML5. Specifies the amount of space (in pixels) between the top and bottom edges of the inline frame and its contents.

marginwidth=

Values: number
Not in HTML5. Specifies the amount of space (in pixels) between the left and right edges of the inline frame and its contents.

name=

Values: text
Deprecated in XHTML 1.0. Assigns a name to the inline frame to be referenced by targeted links.

sandbox=

Values: allow-same-origin | allow-forms | allow-scripts
HTML5 only. Used to disable or enable scripts, pop ups, plug-ins, and form submission in embedded documents.

scrolling=

Values: yes | no | auto
Not in HTML5. Specifies whether scroll bars appear in the frame. A value of yes means scroll bars always appear, a value of no means scroll bars never appear, and a value of auto (the default) means scroll bars appear automatically when the contents do not fit within the frame.

seamless

Values: None in HTML. (seamless="seamless" in XHTML5)
HTML5 only. Makes the browser treat the embedded document as though it were part of the parent document for purposes of link targets, document structure, and CSS inheritance.

src=

Values: URL
Specifies the URL of the HTML document to display initially in the inline frame.

width=

Values: number
Specifies the width of the inline frame in pixels or as a percentage of the window size. Internet Explorer and Navigator use a default width of 300 pixels.
<h1>Inline (Floating) Frames</h1>
<iframe src="list.html" width="200" height="100"
scrolling="auto">
Your browser does not support inline frames. Read the list <a href="list.html">here</a>.
</iframe>

Rendered Example

This element can not be rendered within this application.