HTML inline frames allow a document to be loaded into the page and be displayed like any other element such as an image.
Designers who dissaprove of frames, dissapprove of inline frames only marginally less than standard frames since most of the same drawbacks apply.
The <iframe> has a closing tag since text can be placed between the tags that will only display on browsers that don't support frames.
Example of a Basic Inline Frame
<html>
<head>
</head>
<body>
<iframe>
Your browser does not support frames.
</iframe>
</body>
</html>
<iframe> Attributes
The <iframe> element has a number of attributes some of which are listed below.
The align attribute allows the frame to be aligned in relation to the surrounding text. This attribute is depreciated in 4.01 since it can be set using a style definition. The syntax is align="alignment" where "alignment" may take one of the following values.
align="top" - the text outside the frame is aligned to the top of the frame.
align="middle" - the text outside the frame is aligned with the middle of the frame.
align="bottom" - the text outside the frame is aligned with the bottom of the frame.
align="left" - the frame is aligned to the left of the browser with the text outside to the right.
align="right" - the frame is aligned to the right of the browser with the text outside to the left.
The name attribute allows you to attach a name to the frame in the form name="frame_name" where "frame_name" is a unique name. The name attribute is required if you wish to place a hypertext link in one frame to target another frame.
The src attribute specifies the source file for the frame and takes the form src="url" where "url" is the absolute or relative URL of the page to be displayed in the frame.
The frameborder attribute places a border around the frame and takes the form frameborder="value" where "value" is either
1 to display a border (the default).
0 to display no border.
The marginheight attribute defines the amount of space between the top and bottom edges of the frame and its content and takes the form marginheight="n" where "n" is an amount in pixels not less than 1.
The marginwidth attribute defines the amount of space between the left and right edges of the frame and its content and takes the form marginwidth="n" where "n" is an amount in pixels not less than 1.
The height attribute controls the height of the frame as in height="n" where "n" the height of the frame in pixels.
The width attribute controls the width of the frame as in width="n" where "n" the width of the frame in pixels.
The scrolling attribute creates a frame with or without scrollbars and takes the form scrolling="value" where "value" may be one of those below.
scrolling="yes" means scrollbars are always displayed whether or not the page content fits within the frame
scrolling="no" means scrollbars are never displayed whether or not the page content fits within the frame.
scrolling="auto" means scrollbars are only displayed when the page content does not fit within the frame
The class attribute tells the browser to render the frame in a named style and takes the form <iframe class="my_iframe_style"> where "my_iframe_style" is a previously defined style.